diff --git a/utils/kayobe-automation-redact b/utils/kayobe-automation-redact index a20deb7..17a783c 100755 --- a/utils/kayobe-automation-redact +++ b/utils/kayobe-automation-redact @@ -6,17 +6,22 @@ import base64 import sys annotation_exceptions = { - 'prometheus_bcrypt_salt': 'prometheusbcryptsalt' + 'prometheus_bcrypt_salt': {'original': 'prometheusbcryptsalt.o', 'changed': 'prometheusbcryptsalt.c'}, } + def annotate(ctx, value): if not isinstance(value, str): - return value - path_str = ctx['path'][0] - if path_str in annotation_exceptions: - return f"{annotation_exceptions[path_str]}.{value}" + return value + path_str = *map(str, ctx['path']), + if path_str[0] in annotation_exceptions: + if isinstance(annotation_exceptions[path_str[0]], str): + return annotation_exceptions[path_str[0]] + else: + return annotation_exceptions[path_str[0]][value] else: - return f"{path_str}.{value}" + return f"{'_'.join(path_str)}.{value}" + def redact_int(ctx, x): # For numbers we can't indicate change with a string, so use sentinal values