Skip to content

Commit e5a4e0e

Browse files
committed
fix: add IgnoreUnexported to Node Taints comparison
1 parent 6518ef9 commit e5a4e0e

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

cloud/services/container/nodepools/reconcile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func (s *Service) checkDiffAndPrepareUpdateConfig(existingNodePool *containerpb.
370370
}
371371
}
372372
// Kubernetes taints
373-
if !cmp.Equal(desiredNodePool.GetConfig().GetTaints(), existingNodePool.GetConfig().GetTaints()) {
373+
if !cmp.Equal(desiredNodePool.GetConfig().GetTaints(), existingNodePool.GetConfig().GetTaints(), cmpopts.IgnoreUnexported(containerpb.NodeTaint{})) {
374374
needUpdate = true
375375
updateNodePoolRequest.Taints = &containerpb.NodeTaints{
376376
Taints: desiredNodePool.GetConfig().GetTaints(),

test/e2e/config/gcp-ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ variables:
105105
EXP_MACHINE_POOL: "true"
106106
GKE_MACHINE_POOL_MIN: "1"
107107
GKE_MACHINE_POOL_MAX: "2"
108+
GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY: "0"
109+
GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY: "1"
108110
CAPG_LOGLEVEL: "4"
109111

110112
intervals:

test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,33 @@ spec:
6161
scaling:
6262
minCount: ${GKE_MACHINE_POOL_MIN}
6363
maxCount: ${GKE_MACHINE_POOL_MAX}
64-
64+
---
65+
apiVersion: cluster.x-k8s.io/v1beta1
66+
kind: MachinePool
67+
metadata:
68+
name: ${CLUSTER_NAME}-critical-addons-only
69+
spec:
70+
clusterName: ${CLUSTER_NAME}
71+
replicas: ${WORKER_MACHINE_COUNT}
72+
template:
73+
spec:
74+
bootstrap:
75+
dataSecretName: ""
76+
clusterName: ${CLUSTER_NAME}
77+
infrastructureRef:
78+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
79+
kind: GCPManagedMachinePool
80+
name: ${CLUSTER_NAME}-critical-addons-only
81+
---
82+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
83+
kind: GCPManagedMachinePool
84+
metadata:
85+
name: ${CLUSTER_NAME}-critical-addons-only
86+
spec:
87+
scaling:
88+
minCount: ${GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY}
89+
maxCount: ${GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY}
90+
kubernetesTaints:
91+
- effect: NoSchedule
92+
key: CriticalAddonsOnly
93+
value: "true"

test/e2e/e2e_gke_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ var _ = Describe("GKE workload cluster creation", func() {
9292
Expect(ok).To(BeTrue(), "must have min pool size set via the GKE_MACHINE_POOL_MIN variable")
9393
maxPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MAX"]
9494
Expect(ok).To(BeTrue(), "must have max pool size set via the GKE_MACHINE_POOL_MAX variable")
95+
minCriticalAddonsOnlyPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY"]
96+
Expect(ok).To(BeTrue(), "must have min critical addons only pool size set via the GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY variable")
97+
maxCriticalAddonsOnlyPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY"]
98+
Expect(ok).To(BeTrue(), "must have max critical addons only pool size set via the GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY variable")
9599

96100
ApplyManagedClusterTemplateAndWait(ctx, ApplyManagedClusterTemplateAndWaitInput{
97101
ClusterProxy: bootstrapClusterProxy,
@@ -107,8 +111,10 @@ var _ = Describe("GKE workload cluster creation", func() {
107111
ControlPlaneMachineCount: ptr.To[int64](1),
108112
WorkerMachineCount: ptr.To[int64](3),
109113
ClusterctlVariables: map[string]string{
110-
"GKE_MACHINE_POOL_MIN": minPoolSize,
111-
"GKE_MACHINE_POOL_MAX": maxPoolSize,
114+
"GKE_MACHINE_POOL_MIN": minPoolSize,
115+
"GKE_MACHINE_POOL_MAX": maxPoolSize,
116+
"GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY": minCriticalAddonsOnlyPoolSize,
117+
"GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY": maxCriticalAddonsOnlyPoolSize,
112118
},
113119
},
114120
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),

0 commit comments

Comments
 (0)