Skip to content

Commit

Permalink
Merge pull request #168 from projectsyn/fix/postsync-hook-rbac
Browse files Browse the repository at this point in the history
Remove `hook=PostSync` annotation from hook RBAC
  • Loading branch information
simu authored Jun 27, 2024
2 parents d4648a1 + 756ac9e commit 1b120ec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 33 deletions.
9 changes: 0 additions & 9 deletions component/hooks.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ local name = 'argocd-hooks';
local role = kube.Role(name) {
metadata+: {
namespace: params.namespace,
annotations+: {
'argocd.argoproj.io/hook': 'PostSync',
},
},
rules: [
{
Expand All @@ -31,18 +28,12 @@ local role = kube.Role(name) {
local serviceAccount = kube.ServiceAccount(name) {
metadata+: {
namespace: params.namespace,
annotations+: {
'argocd.argoproj.io/hook': 'PostSync',
},
},
};

local roleBinding = kube.RoleBinding(name) {
metadata+: {
namespace: params.namespace,
annotations+: {
'argocd.argoproj.io/hook': 'PostSync',
},
},
subjects_: [ serviceAccount ],
roleRef_: role,
Expand Down
9 changes: 3 additions & 6 deletions tests/golden/defaults/argocd/argocd/25_hooks/hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down Expand Up @@ -31,8 +30,7 @@ rules:
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand All @@ -41,8 +39,7 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down
9 changes: 3 additions & 6 deletions tests/golden/openshift/argocd/argocd/25_hooks/hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down Expand Up @@ -31,8 +30,7 @@ rules:
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand All @@ -41,8 +39,7 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down
9 changes: 3 additions & 6 deletions tests/golden/params/argocd/argocd/25_hooks/hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down Expand Up @@ -31,8 +30,7 @@ rules:
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand All @@ -41,8 +39,7 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down
9 changes: 3 additions & 6 deletions tests/golden/prometheus/argocd/argocd/25_hooks/hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down Expand Up @@ -31,8 +30,7 @@ rules:
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand All @@ -41,8 +39,7 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
argocd.argoproj.io/hook: PostSync
annotations: {}
labels:
name: argocd-hooks
name: argocd-hooks
Expand Down

0 comments on commit 1b120ec

Please sign in to comment.