INNER CODE UNIT · Python
startswith_any_element_in_list
jupyterhub/zero-to-jupyterhub-k8s · tools/compare-values-schema-content.py:72
def startswith_any_element_in_list(string, in_list):
for s in in_list:
if string.startswith(s):
return True
return False
def get_schema_values_diff(values_file, schema, schema_wildcards):
with open(values_file) as f:
values = yaml.safe_load(f)
values = flatten(values)
return {
v
for v in schema - values
if not startswith_any_element_in_list(v, schema_wildcards)
}