Skip to content

Commit

Permalink
Fix import tests
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
  • Loading branch information
valaparthvi committed Feb 4, 2025
1 parent d9b6b49 commit c38999b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func commonchecks(ctx *helpers.RancherContext, cluster *management.Cluster, clus
cluster, err = ctx.RancherAdminClient.Management.Cluster.ByID(cluster.ID)
Expect(err).To(BeNil())
helpers.ClusterIsReadyChecks(cluster, ctx.RancherAdminClient, clusterName)

// since no changes have been made to the cluster so far, we need reinstantiate AKSConfig after fetching the cluster
if helpers.IsImport {
cluster.AKSConfig = cluster.AKSStatus.UpstreamSpec
}
})

var latestK8sVersion string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ func commonchecks(ctx *helpers.RancherContext, cluster *management.Cluster, clus
cluster, err = ctx.RancherAdminClient.Management.Cluster.ByID(cluster.ID)
Expect(err).To(BeNil())
helpers.ClusterIsReadyChecks(cluster, ctx.RancherAdminClient, clusterName)

// since no changes have been made to the cluster so far, we need reinstantiate EKSConfig after fetching the cluster
if helpers.IsImport {
cluster.EKSConfig = cluster.EKSStatus.UpstreamSpec
}
})

var latestVersion *string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ func commonChartSupportUpgrade(ctx *helpers.RancherContext, cluster *management.
cluster, err = ctx.RancherAdminClient.Management.Cluster.ByID(cluster.ID)
Expect(err).To(BeNil())
helpers.ClusterIsReadyChecks(cluster, ctx.RancherAdminClient, clusterName)

// since no changes have been made to the cluster so far, we need reinstantiate GKEConfig after fetching the cluster
if helpers.IsImport {
cluster.GKEConfig = cluster.GKEStatus.UpstreamSpec
}
})

By(fmt.Sprintf("fetching a list of available k8s versions and ensuring v%s is present in the list and upgrading the cluster to it", k8sUpgradedVersion), func() {
Expand Down

0 comments on commit c38999b

Please sign in to comment.