Skip to content

Commit

Permalink
Merge pull request #54 from projectsyn/fix/finalizers
Browse files Browse the repository at this point in the history
Fix finalizer permission issues for rbac-manager
  • Loading branch information
glrf authored Jan 23, 2023
2 parents 0145772 + c3e94d9 commit 103a807
Show file tree
Hide file tree
Showing 76 changed files with 143 additions and 0 deletions.
27 changes: 27 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,35 @@ local providers = [
for provider in std.objectFields(params.providers)
];

local rbacFinalizerRole = kube.ClusterRole('crossplane-rbac-manager:finalizer') {
rules+: [
{
apiGroups: [
'pkg.crossplane.io',
],
resources: [
'*/finalizers',
],
verbs: [ '*' ],
},
],

};
local rbacFinalizerRoleBinding = kube.ClusterRoleBinding('crossplane-rbac-manager:finalizer') {
roleRef_: rbacFinalizerRole,
subjects: [
{
kind: 'ServiceAccount',
name: 'rbac-manager',
namespace: params.namespace,
},
],
};

{
'00_namespace': kube.Namespace(params.namespace),
'01_rbac_finalizer_clusterrole': rbacFinalizerRole,
'01_rbac_finalizer_clusterrolebinding': rbacFinalizerRoleBinding,
[if std.length(providers) > 0 then '10_providers']: providers,
[if params.monitoring.enabled then '20_monitoring']: import 'monitoring.libsonnet',
[if std.length(controller_configs) > 0 then '30_controller_configs']: controller_configs,
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
rules:
- apiGroups:
- pkg.crossplane.io
resources:
- '*/finalizers'
verbs:
- '*'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane-rbac-manager:finalizer
subjects:
- kind: ServiceAccount
name: rbac-manager
namespace: syn-crossplane
Empty file.
Empty file.
Empty file.
Empty file modified tests/golden/defaults/crossplane/apps/crossplane.yaml
100755 → 100644
Empty file.
Empty file modified tests/golden/defaults/crossplane/crossplane/00_namespace.yaml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
rules:
- apiGroups:
- pkg.crossplane.io
resources:
- '*/finalizers'
verbs:
- '*'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane-rbac-manager:finalizer
subjects:
- kind: ServiceAccount
name: rbac-manager
namespace: syn-crossplane
Empty file.
Empty file modified tests/golden/defaults/crossplane/crossplane/20_monitoring.yaml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
rules:
- apiGroups:
- pkg.crossplane.io
resources:
- '*/finalizers'
verbs:
- '*'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane-rbac-manager:finalizer
subjects:
- kind: ServiceAccount
name: rbac-manager
namespace: syn-crossplane
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified tests/golden/openshift4/crossplane/apps/crossplane.yaml
100755 → 100644
Empty file.
Empty file modified tests/golden/openshift4/crossplane/crossplane/00_namespace.yaml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
rules:
- apiGroups:
- pkg.crossplane.io
resources:
- '*/finalizers'
verbs:
- '*'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: crossplane-rbac-manager-finalizer
name: crossplane-rbac-manager:finalizer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: crossplane-rbac-manager:finalizer
subjects:
- kind: ServiceAccount
name: rbac-manager
namespace: syn-crossplane
Empty file.
Empty file.

0 comments on commit 103a807

Please sign in to comment.