Skip to content

Commit

Permalink
Merge pull request #5541 from shysank/pre_init_hook_backport
Browse files Browse the repository at this point in the history
 🌱 Add pre init hook to clusterctl upgrade test (release-1.0)
  • Loading branch information
k8s-ci-robot authored Nov 1, 2021
2 parents e09ed61 + df506c2 commit 2239bf0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/clusterctl_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type ClusterctlUpgradeSpecInput struct {
// provider contract to use to initialise the secondary management cluster, e.g. `v1alpha3`
InitWithProvidersContract string
SkipCleanup bool
PreInit func(managementClusterProxy framework.ClusterProxy)
PreUpgrade func(managementClusterProxy framework.ClusterProxy)
PostUpgrade func(managementClusterProxy framework.ClusterProxy)
MgmtFlavor string
Expand Down Expand Up @@ -206,6 +207,11 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
contract = input.InitWithProvidersContract
}

if input.PreInit != nil {
By("Running Pre-init steps against the management cluster")
input.PreInit(managementClusterProxy)
}

clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
ClusterctlBinaryPath: clusterctlBinaryPath, // use older version of clusterctl to init the management cluster
ClusterProxy: managementClusterProxy,
Expand Down

0 comments on commit 2239bf0

Please sign in to comment.