From 9adfc448a727dc92c45aab19a929c8c507dcc4c2 Mon Sep 17 00:00:00 2001 From: Ian Lewis Date: Thu, 9 Nov 2023 14:58:05 +0000 Subject: [PATCH] Remove deprecated keys from kustomize yaml files (#504) * Remove deprecated kustomize keys And fix up the patch files, as some kustomozie versions require 1 resource patch per file --- .../watch-all-namespaces/kustomization.yaml | 10 +++--- .../examples/watch-all-namespaces/olo-ns.yaml | 20 ----------- .../examples/watch-all-namespaces/role1.yaml | 8 +++++ .../examples/watch-all-namespaces/role2.yaml | 8 +++++ .../olo-ns2/kustomization.yaml | 15 +++++---- .../olo-ns2/olo-roles.yaml | 29 ---------------- .../olo-ns2/role1.yaml | 5 +++ .../olo-ns2/role2.yaml | 5 +++ .../olo-ns2/role3.yaml | 8 +++++ .../olo-ns2/role4.yaml | 8 +++++ .../olo-watched-ns2/kustomization.yaml | 11 ++++--- .../olo-watched-ns2/role1.yaml | 5 +++ .../olo-watched-ns2/role2.yaml | 9 +++++ .../olo-watched-ns2/role3.yaml | 5 +++ .../olo-watched-ns2/role4.yaml | 9 +++++ .../olo-watched-ns2/watched-roles.yaml | 31 ----------------- .../watch-own-namespace/kustomization.yaml | 4 +-- .../watch-all-namespaces/kustomization.yaml | 8 ++--- .../olo-ns/kustomization.yaml | 15 +++++---- .../olo-ns/olo-roles.yaml | 33 ------------------- .../watch-another-namespace/olo-ns/role1.yaml | 5 +++ .../watch-another-namespace/olo-ns/role2.yaml | 5 +++ .../watch-another-namespace/olo-ns/role3.yaml | 9 +++++ .../watch-another-namespace/olo-ns/role4.yaml | 9 +++++ 24 files changed, 132 insertions(+), 142 deletions(-) delete mode 100644 internal/deploy/kustomize/daily/examples/watch-all-namespaces/olo-ns.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-all-namespaces/role1.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-all-namespaces/role2.yaml delete mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/olo-roles.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role1.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role2.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role3.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role4.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role1.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role2.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role3.yaml create mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role4.yaml delete mode 100644 internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/watched-roles.yaml delete mode 100644 internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/olo-roles.yaml create mode 100644 internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role1.yaml create mode 100644 internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role2.yaml create mode 100644 internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role3.yaml create mode 100644 internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role4.yaml diff --git a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/kustomization.yaml b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/kustomization.yaml index bc16bacf5..4fd9a9f75 100644 --- a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/kustomization.yaml +++ b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/kustomization.yaml @@ -3,9 +3,9 @@ kind: Kustomization namespace: olo-ns -bases: -- ../../overlays/watch-all-namespaces - -patchesStrategicMerge: -- olo-ns.yaml +resources: +- ../../overlays/watch-all-namespaces +patches: +- path: role1.yaml +- path: role2.yaml diff --git a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/olo-ns.yaml b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/olo-ns.yaml deleted file mode 100644 index e187d8e7f..000000000 --- a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/olo-ns.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: olo-leader-election-cluster-rolebinding -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: olo-ns ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: olo-manager-cluster-rolebinding -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: olo-ns ---- - diff --git a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role1.yaml b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role1.yaml new file mode 100644 index 000000000..2d06eb32a --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role1.yaml @@ -0,0 +1,8 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: olo-leader-election-cluster-rolebinding +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: olo-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role2.yaml b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role2.yaml new file mode 100644 index 000000000..4e68597cf --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-all-namespaces/role2.yaml @@ -0,0 +1,8 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: olo-manager-cluster-rolebinding +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: olo-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/kustomization.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/kustomization.yaml index 93775df40..e7e4e2d81 100644 --- a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/kustomization.yaml +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/kustomization.yaml @@ -2,10 +2,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: olo-ns2 -bases: -- ../../../overlays/watch-another-namespace -patchesStrategicMerge: -- olo-deployment.yaml -- olo-roles.yaml -- olo-sa.yaml +resources: +- ../../../overlays/watch-another-namespace +patches: +- path: olo-deployment.yaml +- path: role1.yaml +- path: role2.yaml +- path: role3.yaml +- path: role4.yaml +- path: olo-sa.yaml diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/olo-roles.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/olo-roles.yaml deleted file mode 100644 index e2fadfe8d..000000000 --- a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/olo-roles.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-leader-election-role - namespace: olo-ns ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-manager-role - namespace: olo-ns ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-leader-election-rolebinding - namespace: olo-ns -subjects: -- kind: ServiceAccount - name: olo-controller-manager ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-manager-rolebinding - namespace: olo-ns -subjects: -- kind: ServiceAccount - name: olo-controller-manager diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role1.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role1.yaml new file mode 100644 index 000000000..67ddee932 --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role1.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-leader-election-role + namespace: olo-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role2.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role2.yaml new file mode 100644 index 000000000..276b1b23f --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role2.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-manager-role + namespace: olo-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role3.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role3.yaml new file mode 100644 index 000000000..4dc101d53 --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role3.yaml @@ -0,0 +1,8 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-leader-election-rolebinding + namespace: olo-ns +subjects: +- kind: ServiceAccount + name: olo-controller-manager diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role4.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role4.yaml new file mode 100644 index 000000000..6c8e489d0 --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-ns2/role4.yaml @@ -0,0 +1,8 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-manager-rolebinding + namespace: olo-ns +subjects: +- kind: ServiceAccount + name: olo-controller-manager diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/kustomization.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/kustomization.yaml index 351059a23..aae8548ba 100644 --- a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/kustomization.yaml +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/kustomization.yaml @@ -2,8 +2,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: olo-watched-ns2 -bases: -- ../../../overlays/watch-another-namespace/olo-watched-ns -patchesStrategicMerge: -- watched-roles.yaml \ No newline at end of file +resources: +- ../../../overlays/watch-another-namespace/olo-watched-ns +patches: +- path: role1.yaml +- path: role2.yaml +- path: role3.yaml +- path: role4.yaml diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role1.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role1.yaml new file mode 100644 index 000000000..927af5c01 --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role1.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-watched-role + namespace: olo-watched-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role2.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role2.yaml new file mode 100644 index 000000000..47c3c1864 --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role2.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-watched-rolebinding + namespace: olo-watched-ns +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: olo-ns2 diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role3.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role3.yaml new file mode 100644 index 000000000..bd4b5890c --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role3.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-leader-election-watched-role + namespace: olo-watched-ns diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role4.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role4.yaml new file mode 100644 index 000000000..a328f81bb --- /dev/null +++ b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/role4.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-leader-election-watched-rolebinding + namespace: olo-watched-ns +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: olo-ns2 diff --git a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/watched-roles.yaml b/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/watched-roles.yaml deleted file mode 100644 index e2799f497..000000000 --- a/internal/deploy/kustomize/daily/examples/watch-another-namespace/olo-watched-ns2/watched-roles.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-watched-role - namespace: olo-watched-ns ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-watched-rolebinding - namespace: olo-watched-ns -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: olo-ns2 ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-leader-election-watched-role - namespace: olo-watched-ns ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-leader-election-watched-rolebinding - namespace: olo-watched-ns -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: olo-ns2 diff --git a/internal/deploy/kustomize/daily/examples/watch-own-namespace/kustomization.yaml b/internal/deploy/kustomize/daily/examples/watch-own-namespace/kustomization.yaml index 6b8c0fc9a..2d41b9542 100644 --- a/internal/deploy/kustomize/daily/examples/watch-own-namespace/kustomization.yaml +++ b/internal/deploy/kustomize/daily/examples/watch-own-namespace/kustomization.yaml @@ -3,7 +3,5 @@ kind: Kustomization namespace: olo-ns -bases: +resources: - ../../base - - diff --git a/internal/deploy/kustomize/daily/overlays/watch-all-namespaces/kustomization.yaml b/internal/deploy/kustomize/daily/overlays/watch-all-namespaces/kustomization.yaml index 9e4a3efe3..125fe87cc 100644 --- a/internal/deploy/kustomize/daily/overlays/watch-all-namespaces/kustomization.yaml +++ b/internal/deploy/kustomize/daily/overlays/watch-all-namespaces/kustomization.yaml @@ -3,12 +3,10 @@ kind: Kustomization namespace: open-liberty -bases: -- ../../base resources: - cluster-roles.yaml +- ../../base -patchesStrategicMerge: -- olo-all-namespaces.yaml - +patches: +- path: olo-all-namespaces.yaml diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/kustomization.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/kustomization.yaml index 102ca853a..a58df808e 100644 --- a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/kustomization.yaml +++ b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/kustomization.yaml @@ -2,10 +2,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: olo-ns -bases: -- ../../../base -patchesStrategicMerge: -- olo-deployment.yaml -- olo-roles.yaml -- olo-sa.yaml +resources: +- ../../../base +patches: +- path: olo-deployment.yaml +- path: role1.yaml +- path: role2.yaml +- path: role3.yaml +- path: role4.yaml +- path: olo-sa.yaml diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/olo-roles.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/olo-roles.yaml deleted file mode 100644 index 547efcb26..000000000 --- a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/olo-roles.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-leader-election-role - namespace: open-liberty ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: olo-manager-role - namespace: open-liberty ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-leader-election-rolebinding - namespace: open-liberty -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: open-liberty ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: olo-manager-rolebinding - namespace: open-liberty -subjects: -- kind: ServiceAccount - name: olo-controller-manager - namespace: open-liberty - - diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role1.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role1.yaml new file mode 100644 index 000000000..d3b817c25 --- /dev/null +++ b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role1.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-leader-election-role + namespace: open-liberty diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role2.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role2.yaml new file mode 100644 index 000000000..e1b9800a4 --- /dev/null +++ b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role2.yaml @@ -0,0 +1,5 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: olo-manager-role + namespace: open-liberty diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role3.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role3.yaml new file mode 100644 index 000000000..805a3d1fb --- /dev/null +++ b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role3.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-leader-election-rolebinding + namespace: open-liberty +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: open-liberty diff --git a/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role4.yaml b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role4.yaml new file mode 100644 index 000000000..ae843e271 --- /dev/null +++ b/internal/deploy/kustomize/daily/overlays/watch-another-namespace/olo-ns/role4.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: olo-manager-rolebinding + namespace: open-liberty +subjects: +- kind: ServiceAccount + name: olo-controller-manager + namespace: open-liberty