Skip to content

Commit

Permalink
Revert nodepool k8s assignment
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <[email protected]>
  • Loading branch information
valaparthvi committed Jan 21, 2025
1 parent 425f3b5 commit 0c71b64
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
36 changes: 19 additions & 17 deletions hosted/aks/helper/helper_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ func UpgradeClusterKubernetesVersion(cluster *management.Cluster, upgradeToVersi
// ensure nodepool version is still the same when config is applied
// NOTE: this check will fail if nodepool version at the beginning is different from cluster version
for _, np := range cluster.AKSConfig.NodePools {
Expect(*np.OrchestratorVersion).To(Equal(currentVersion))
// For a newly added node pool still in provisioning phase, this value might be nil
if np.OrchestratorVersion != nil {
Expect(*np.OrchestratorVersion).To(Equal(currentVersion))
}
}

// Check if the desired config has been applied in Rancher
Expand Down Expand Up @@ -200,22 +203,21 @@ func AddNodePool(cluster *management.Cluster, increaseBy int, client *rancher.Cl

for i := 1; i <= increaseBy; i++ {
newNodepool := management.AKSNodePool{
AvailabilityZones: npTemplate.AvailabilityZones,
Count: pointer.Int64(1),
EnableAutoScaling: npTemplate.EnableAutoScaling,
MaxCount: npTemplate.MaxCount,
MaxPods: npTemplate.MaxPods,
MaxSurge: npTemplate.MaxSurge,
MinCount: npTemplate.MinCount,
Mode: npTemplate.Mode,
Name: pointer.String(namegen.RandStringLower(5)),
NodeLabels: npTemplate.NodeLabels,
NodeTaints: npTemplate.NodeTaints,
OrchestratorVersion: cluster.AKSConfig.KubernetesVersion,
OsDiskSizeGB: npTemplate.OsDiskSizeGB,
OsDiskType: npTemplate.OsDiskType,
OsType: npTemplate.OsType,
VMSize: npTemplate.VMSize,
AvailabilityZones: npTemplate.AvailabilityZones,
Count: pointer.Int64(1),
EnableAutoScaling: npTemplate.EnableAutoScaling,
MaxCount: npTemplate.MaxCount,
MaxPods: npTemplate.MaxPods,
MaxSurge: npTemplate.MaxSurge,
MinCount: npTemplate.MinCount,
Mode: npTemplate.Mode,
Name: pointer.String(namegen.RandStringLower(5)),
NodeLabels: npTemplate.NodeLabels,
NodeTaints: npTemplate.NodeTaints,
OsDiskSizeGB: npTemplate.OsDiskSizeGB,
OsDiskType: npTemplate.OsDiskType,
OsType: npTemplate.OsType,
VMSize: npTemplate.VMSize,
}
updateNodePoolsList = append(updateNodePoolsList, newNodepool)

Expand Down
2 changes: 1 addition & 1 deletion hosted/aks/p1/p1_import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ var _ = Describe("P1Import", func() {
testCaseID = 269
npUpgradeToVersionGTCPCheck(cluster, ctx.RancherAdminClient, upgradeK8sVersion)
})
FIt("should Update a cluster when a cluster is in Updating State", func() {
It("should Update a cluster when a cluster is in Updating State", func() {
testCaseID = 303
updateClusterWhenUpdating(cluster, ctx.RancherAdminClient, upgradeK8sVersion)
})
Expand Down

0 comments on commit 0c71b64

Please sign in to comment.