mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
do not install priority class if noOpoerator is true (#928)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{{- if not .Values.noOperator }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
apiVersion: scheduling.k8s.io/v1
|
||||
kind: PriorityClass
|
||||
@@ -8,3 +9,4 @@ globalDefault: false
|
||||
description: "This priority class should be used for klusterlet agents only."
|
||||
preemptionPolicy: PreemptLowerPriority
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -326,6 +326,20 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
},
|
||||
expectedObjCnt: 1,
|
||||
},
|
||||
{
|
||||
name: "noOperator with priority cluster",
|
||||
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.PriorityClassName = "klusterlet-critical"
|
||||
return config
|
||||
},
|
||||
expectedObjCnt: 1,
|
||||
},
|
||||
{
|
||||
name: "noOperator with image pull secret",
|
||||
namespace: "ocm",
|
||||
@@ -335,6 +349,7 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
config.Klusterlet.Name = "klusterlet2"
|
||||
config.Klusterlet.Namespace = "open-cluster-management-test"
|
||||
config.Klusterlet.ClusterName = "testCluster"
|
||||
config.PriorityClassName = "klusterlet-critical"
|
||||
config.Images = ImagesConfig{
|
||||
ImageCredentials: ImageCredentials{
|
||||
CreateImageCredentials: true,
|
||||
@@ -453,6 +468,9 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
if object.Spec.ClusterName != config.Klusterlet.ClusterName {
|
||||
t.Errorf(" expected %s, got %s", config.Klusterlet.ClusterName, object.Spec.ClusterName)
|
||||
}
|
||||
if object.Spec.PriorityClassName != config.PriorityClassName {
|
||||
t.Errorf(" expected %s, got %s", config.PriorityClassName, object.Spec.PriorityClassName)
|
||||
}
|
||||
switch config.Klusterlet.Mode {
|
||||
case "", operatorv1.InstallModeSingleton, operatorv1.InstallModeDefault:
|
||||
if config.Klusterlet.Mode == "" && object.Spec.DeployOption.Mode != operatorv1.InstallModeSingleton {
|
||||
|
||||
Reference in New Issue
Block a user