Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheYkk committed Feb 13, 2021
2 parents b9fab61 + 4922b67 commit 8848325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rules:
resources: [events]
verbs: [create]
- apiGroups: [""]
resources: ["namespaces", "pods", "replicasets"]
resources: ["namespaces", "pods", "replicasets", "namespaces/status"]
verbs: ["*"]
---
kind: ClusterRoleBinding
Expand Down Expand Up @@ -54,4 +54,4 @@ spec:
serviceAccountName: synator
containers:
- name: synator
image: theykk/synator:v1.0.0
image: theykk/synator:v1.1.0
5 changes: 3 additions & 2 deletions handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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
Expand Down Expand Up @@ -128,7 +128,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', when=watch_namespace)
Expand Down

0 comments on commit 8848325

Please sign in to comment.