in apps/replikate/src/main.py [0:0]
def update_ignore_namespace(logger, name, meta, **_) -> bool:
""" Returns true if added to the ignore list """
labels={**meta.get('labels', {}), **meta.get('annotations', {})}
ignore = labels.get(OPERATOR_ENABLED, "enabled") == "disabled"
result = False;
if ignore and name not in IGNORE_NAMESPACES:
logger.info(f"Namespace {name} has ignore annotation, I will ignore all objects in it")
IGNORE_NAMESPACES.append(name)
result = True
elif not ignore and name in OPERATOR_ENABLED:
logger.info(f"Namespace {name} has no more ignore annotation")
IGNORE_NAMESPACES.remove(name)
else:
profile_owner = [own for own in meta.get('ownerReferences', []) if own.get('kind') == 'Profile' and path.dirname(own.get('apiVersion', '')) == 'kubeflow.org']
if not profile_owner and name not in IGNORE_NAMESPACES:
logger.info(f"Ignoring all objects in namespace {name}")
IGNORE_NAMESPACES.append(name)
result = True
return result