Skip to content

Commit

Permalink
Add missing RBAC and error handler for secret update
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Vasko <[email protected]>
  • Loading branch information
Lirt committed Nov 7, 2023
1 parent 11ad46d commit 451cda1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ rules:
- get
- create
- watch
- update
- apiGroups: [""]
resources:
- namespaces
verbs:
- watch
- list

---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ func watchSourceSecret(client *kubernetes.Clientset, watchApi watchapi.Interface
logger.Info("Skip updating secret in source namespace")
continue
}
helpers.UpdateExistingSecret(client, logger, event.Object.(*v1.Secret), sourceSecretName, ns.Name)
err = helpers.UpdateExistingSecret(client, logger, event.Object.(*v1.Secret), sourceSecretName, ns.Name)
if err != nil {
logger.Error("failed to update secret",
zap.String("name", sourceSecretName),
zap.String("namespace", ns.Name),
zap.Error(err),
)
}
}
}
}
Expand Down

0 comments on commit 451cda1

Please sign in to comment.