Skip to content

Commit

Permalink
add new kustomization e2e test yamls (#406)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangjing Li <xiangli@redhat.com>
  • Loading branch information
xiangjingli authored Jul 9, 2024
1 parent 5aeb0f3 commit 384803b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/gitrepo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ func TestSortResources(t *testing.T) {
chartDirs, kustomizeDirs, crdsAndNamespaceFiles, rbacFiles, otherFiles, err := SortResources("../..", "../../test/github")
g.Expect(err).NotTo(gomega.HaveOccurred())
g.Expect(len(chartDirs)).To(gomega.Equal(4))
g.Expect(len(kustomizeDirs)).To(gomega.Equal(7))
g.Expect(len(kustomizeDirs)).To(gomega.Equal(9))
g.Expect(len(crdsAndNamespaceFiles)).To(gomega.Equal(2))
g.Expect(len(rbacFiles)).To(gomega.Equal(3))
g.Expect(len(otherFiles)).To(gomega.Equal(5))
Expand Down
23 changes: 23 additions & 0 deletions test/github/kustomizeLabels/base/KlusterletAddonConfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: agent.open-cluster-management.io/v1
kind: KlusterletAddonConfig
metadata:
name: REPLACED BY KUSTOMIZE
namespace: REPLACED BY KUSTOMIZE
spec:
clusterName: REPLACED BY KUSTOMIZE
clusterNamespace: REPLACED BY KUSTOMIZE
applicationManager:
enabled: true
certPolicyController:
enabled: true
clusterLabels:
cloud: auto-detect
vendor: auto-detect
iamPolicyController:
enabled: true
policyController:
enabled: true
searchCollector:
enabled: true
version: 2.2.0
10 changes: 10 additions & 0 deletions test/github/kustomizeLabels/base/ManagedCluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
metadata:
name: REPLACED BY KUSTOMIZE
namespace: REPLACED BY KUSTOMIZE
labels: #LABELS ADDED BY KUSTOMIZE

spec:
hubAcceptsClient: true
7 changes: 7 additions & 0 deletions test/github/kustomizeLabels/base/Namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
kind: Namespace
apiVersion: v1
metadata:
name: REPLACED BY KUSTOMIZE
labels:
#cluster.open-cluster-management.io/managedCluster:
7 changes: 7 additions & 0 deletions test/github/kustomizeLabels/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- KlusterletAddonConfig.yaml
- ManagedCluster.yaml
- Namespace.yaml
42 changes: 42 additions & 0 deletions test/github/kustomizeLabels/namctigtd27d/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
resources:
- ../base

patches:
- target:
kind: KlusterletAddonConfig
patch: |
- op: replace
path: /metadata/name
value: "namctigtd27d"
- op: replace
path: /metadata/namespace
value: "namctigtd27d"
- op: replace
path: /spec/clusterName
value: "namctigtd27d"
- op: replace
path: /spec/clusterNamespace
value: "namctigtd27d"
- target:
kind: ManagedCluster
patch: |
- op: replace
path: /metadata/name
value: "namctigtd27d"
- op: replace
path: /metadata/namespace
value: "namctigtd27d"
- op: add
path: /metadata/labels
value:
environment: dev
test1: test1
test2: test2
vault-csi-provider-enabled: true
- target:
kind: Namespace
patch: |
- op: replace
path: /metadata/name
value: "namctigtd27d"

0 comments on commit 384803b

Please sign in to comment.