mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
update klusterlet helm chart (#925)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
{{- $generatedNamespace := include "agentNamespace" . }}
|
||||
{{- if ne $generatedNamespace .Release.Namespace }}
|
||||
{{- if or .Values.bootstrapHubKubeConfig .Values.externalManagedKubeConfig .Values.multiHubBootstrapHubKubeConfigs }}
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
@@ -6,3 +8,4 @@ metadata:
|
||||
workload.openshift.io/allowed: "management"
|
||||
name: "{{ template "agentNamespace" . }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{{- if not .Values.noOperator }}
|
||||
{{- if .Values.images.imageCredentials.createImageCredentials }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -11,4 +10,3 @@ type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "imagePullSecret" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -326,6 +326,27 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
},
|
||||
expectedObjCnt: 1,
|
||||
},
|
||||
{
|
||||
name: "noOperator with image pull secret",
|
||||
namespace: "ocm",
|
||||
chartConfig: func() *KlusterletChartConfig {
|
||||
config := NewDefaultKlusterletChartConfig()
|
||||
config.NoOperator = true
|
||||
config.Klusterlet.Name = "klusterlet2"
|
||||
config.Klusterlet.Namespace = "open-cluster-management-test"
|
||||
config.Klusterlet.ClusterName = "testCluster"
|
||||
config.Images = ImagesConfig{
|
||||
ImageCredentials: ImageCredentials{
|
||||
CreateImageCredentials: true,
|
||||
UserName: "test",
|
||||
Password: "test",
|
||||
},
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
||||
expectedObjCnt: 2,
|
||||
},
|
||||
{
|
||||
name: "create namespace",
|
||||
namespace: "open-cluster-management",
|
||||
@@ -338,6 +359,33 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
},
|
||||
expectedObjCnt: 6,
|
||||
},
|
||||
{
|
||||
name: "create namespace with bootstrap secret",
|
||||
namespace: "open-cluster-management",
|
||||
chartConfig: func() *KlusterletChartConfig {
|
||||
config := NewDefaultKlusterletChartConfig()
|
||||
config.Klusterlet.ClusterName = "testCluster"
|
||||
config.Klusterlet.Mode = operatorv1.InstallModeSingleton
|
||||
config.CreateNamespace = true
|
||||
config.BootstrapHubKubeConfig = "kubeconfig"
|
||||
|
||||
return config
|
||||
},
|
||||
expectedObjCnt: 8,
|
||||
},
|
||||
{
|
||||
name: "create namespace with bootstrap secret and release.Namespace is the agent namespace",
|
||||
namespace: "open-cluster-management-agent",
|
||||
chartConfig: func() *KlusterletChartConfig {
|
||||
config := NewDefaultKlusterletChartConfig()
|
||||
config.Klusterlet.ClusterName = "testCluster"
|
||||
config.Klusterlet.Mode = operatorv1.InstallModeSingleton
|
||||
config.CreateNamespace = true
|
||||
config.BootstrapHubKubeConfig = "kubeconfig"
|
||||
return config
|
||||
},
|
||||
expectedObjCnt: 7,
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
|
||||
Reference in New Issue
Block a user