From 5f22b9daf493a5617f0aa731311237c53b62c3fa Mon Sep 17 00:00:00 2001 From: Kaan Karakaya Date: Sat, 13 Feb 2021 17:26:04 +0300 Subject: [PATCH 1/3] check secret has annotation Signed-off-by: Kaan Karakaya --- handlers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handlers.py b/handlers.py index a1cc92c..8c17d68 100644 --- a/handlers.py +++ b/handlers.py @@ -89,7 +89,7 @@ def newNamespace(spec, name, meta, logger, **kwargs): # TODO: Add configmap for secret in api_response.items: # Check secret have annotation - if secret.metadata.annotations.get("synator/sync") == "yes": + if secret.metadata.annotations and secret.metadata.annotations.get("synator/sync") == "yes": secret.metadata.annotations.pop('synator/sync') secret.metadata.resource_version = None secret.metadata.uid = None @@ -121,7 +121,8 @@ def reload_pod_config(body, meta, spec, status, old, new, diff, **kwargs): if pod.metadata.annotations: if pod.metadata.annotations.get('synator/reload') == 'configmap:' + meta.name: # Reload pod - api.delete_namespaced_pod(pod.metadata.name, pod.metadata.namespace) + api.delete_namespaced_pod( + pod.metadata.name, pod.metadata.namespace) @kopf.on.update('', 'v1', 'secrets') From 8686bf871efe341bad5d2339d5ae4e3a6d09edfd Mon Sep 17 00:00:00 2001 From: Kaan Karakaya Date: Sat, 13 Feb 2021 17:26:47 +0300 Subject: [PATCH 2/3] Fix 403 namespace status Signed-off-by: Kaan Karakaya --- deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.yml b/deploy.yml index b6d00fd..a5ddc12 100644 --- a/deploy.yml +++ b/deploy.yml @@ -20,7 +20,7 @@ rules: resources: [events] verbs: [create] - apiGroups: [""] - resources: ["namespaces", "pods", "replicasets"] + resources: ["namespaces", "pods", "replicasets", "namespaces/status"] verbs: ["*"] --- kind: ClusterRoleBinding From 4922b675a2d5bf238f5a3f36c39785f982657184 Mon Sep 17 00:00:00 2001 From: Kaan Karakaya Date: Sat, 13 Feb 2021 17:28:58 +0300 Subject: [PATCH 3/3] Update Synator version Signed-off-by: Kaan Karakaya --- deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.yml b/deploy.yml index a5ddc12..dbec697 100644 --- a/deploy.yml +++ b/deploy.yml @@ -54,4 +54,4 @@ spec: serviceAccountName: synator containers: - name: synator - image: theykk/synator:v1.0.0 + image: theykk/synator:v1.1.0