fixin
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- sync-configmaps.yaml
|
||||
- sync-git-token.yaml
|
||||
@@ -0,0 +1,29 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: sync-flux-configmaps
|
||||
annotations:
|
||||
kustomize.toolkit.fluxcd.io/force: "Enabled"
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: false
|
||||
generateExisting: true
|
||||
rules:
|
||||
# This rule ensures that all namespaces
|
||||
# have a copy of the flux-runtime-info configmap from the flux-system namespace.
|
||||
- name: sync-configmaps
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- v1/Namespace
|
||||
generate:
|
||||
namespace: "{{request.object.metadata.name}}"
|
||||
synchronize: true
|
||||
cloneList:
|
||||
namespace: flux-system
|
||||
kinds:
|
||||
- v1/ConfigMap
|
||||
selector:
|
||||
matchLabels:
|
||||
toolkit.fluxcd.io/runtime: "true"
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: sync-git-token
|
||||
spec:
|
||||
mutateExistingOnPolicyUpdate: true
|
||||
rules:
|
||||
- name: copy-token-from-password
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Secret
|
||||
names:
|
||||
- flux-system
|
||||
namespaces:
|
||||
- flux-system
|
||||
mutate:
|
||||
targets:
|
||||
- apiVersion: v1
|
||||
kind: Secret
|
||||
name: flux-system
|
||||
namespace: flux-system
|
||||
patchesJson6902: |-
|
||||
- op: add
|
||||
path: "/data/token"
|
||||
value: "{{ request.object.data.password }}"
|
||||
Reference in New Issue
Block a user