diff --git a/test/e2e/clusterctl_upgrade.go b/test/e2e/clusterctl_upgrade.go index 165c3f4f0e1e..2a5aafd105a5 100644 --- a/test/e2e/clusterctl_upgrade.go +++ b/test/e2e/clusterctl_upgrade.go @@ -85,10 +85,12 @@ type ClusterctlUpgradeSpecInput struct { CNIManifestPath string WorkloadFlavor string // Custom providers can be specified to upgrade to a pre-release or a custom version instead of upgrading to the latest using contact - CoreProvider string - BootstrapProviders []string - ControlPlaneProviders []string - InfrastructureProviders []string + CoreProvider string + BootstrapProviders []string + ControlPlaneProviders []string + InfrastructureProviders []string + IPAMProviders []string + RuntimeExtensionProviders []string } // ClusterctlUpgradeSpec implements a test that verifies clusterctl upgrade of a management cluster. @@ -350,15 +352,17 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg By("Upgrading providers to the latest version available using contract or to custom providers version if specified") clusterctl.UpgradeManagementClusterAndWait(ctx, clusterctl.UpgradeManagementClusterAndWaitInput{ - ClusterctlConfigPath: input.ClusterctlConfigPath, - ClusterctlVariables: input.UpgradeClusterctlVariables, - ClusterProxy: managementClusterProxy, - Contract: clusterv1.GroupVersion.Version, - CoreProvider: input.CoreProvider, - BootstrapProviders: input.BootstrapProviders, - ControlPlaneProviders: input.ControlPlaneProviders, - InfrastructureProviders: input.InfrastructureProviders, - LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name), + ClusterctlConfigPath: input.ClusterctlConfigPath, + ClusterctlVariables: input.UpgradeClusterctlVariables, + ClusterProxy: managementClusterProxy, + Contract: clusterv1.GroupVersion.Version, + CoreProvider: input.CoreProvider, + BootstrapProviders: input.BootstrapProviders, + ControlPlaneProviders: input.ControlPlaneProviders, + InfrastructureProviders: input.InfrastructureProviders, + IPAMProviders: input.IPAMProviders, + RuntimeExtensionProviders: input.RuntimeExtensionProviders, + LogFolder: filepath.Join(input.ArtifactFolder, "clusters", cluster.Name), }, input.E2EConfig.GetIntervals(specName, "wait-controllers")...) By("THE MANAGEMENT CLUSTER WAS SUCCESSFULLY UPGRADED!") diff --git a/test/framework/clusterctl/client.go b/test/framework/clusterctl/client.go index e94508ee7c60..b6944f6d4734 100644 --- a/test/framework/clusterctl/client.go +++ b/test/framework/clusterctl/client.go @@ -139,16 +139,18 @@ func InitWithBinary(_ context.Context, binary string, input InitInput) { // UpgradeInput is the input for Upgrade. type UpgradeInput struct { - LogFolder string - ClusterctlConfigPath string - ClusterctlVariables map[string]string - ClusterName string - KubeconfigPath string - Contract string - CoreProvider string - BootstrapProviders []string - ControlPlaneProviders []string - InfrastructureProviders []string + LogFolder string + ClusterctlConfigPath string + ClusterctlVariables map[string]string + ClusterName string + KubeconfigPath string + Contract string + CoreProvider string + BootstrapProviders []string + ControlPlaneProviders []string + InfrastructureProviders []string + IPAMProviders []string + RuntimeExtensionProviders []string } // Upgrade calls clusterctl upgrade apply with the list of providers defined in the local repository. @@ -174,12 +176,14 @@ func Upgrade(ctx context.Context, input UpgradeInput) { Path: input.KubeconfigPath, Context: "", }, - Contract: input.Contract, - CoreProvider: input.CoreProvider, - BootstrapProviders: input.BootstrapProviders, - ControlPlaneProviders: input.ControlPlaneProviders, - InfrastructureProviders: input.InfrastructureProviders, - WaitProviders: true, + Contract: input.Contract, + CoreProvider: input.CoreProvider, + BootstrapProviders: input.BootstrapProviders, + ControlPlaneProviders: input.ControlPlaneProviders, + InfrastructureProviders: input.InfrastructureProviders, + IPAMProviders: input.IPAMProviders, + RuntimeExtensionProviders: input.RuntimeExtensionProviders, + WaitProviders: true, } clusterctlClient, log := getClusterctlClientWithLogger(input.ClusterctlConfigPath, "clusterctl-upgrade.log", input.LogFolder) diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index 7e5bc8986d30..852f3c3e6758 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -127,15 +127,17 @@ func InitManagementClusterAndWatchControllerLogs(ctx context.Context, input Init // UpgradeManagementClusterAndWaitInput is the input type for UpgradeManagementClusterAndWait. type UpgradeManagementClusterAndWaitInput struct { - ClusterProxy framework.ClusterProxy - ClusterctlConfigPath string - ClusterctlVariables map[string]string - Contract string - CoreProvider string - BootstrapProviders []string - ControlPlaneProviders []string - InfrastructureProviders []string - LogFolder string + ClusterProxy framework.ClusterProxy + ClusterctlConfigPath string + ClusterctlVariables map[string]string + Contract string + CoreProvider string + BootstrapProviders []string + ControlPlaneProviders []string + InfrastructureProviders []string + IPAMProviders []string + RuntimeExtensionProviders []string + LogFolder string } // UpgradeManagementClusterAndWait upgrades provider a management cluster using clusterctl, and waits for the cluster to be ready. @@ -147,23 +149,27 @@ func UpgradeManagementClusterAndWait(ctx context.Context, input UpgradeManagemen isCustomUpgrade := input.CoreProvider != "" || len(input.BootstrapProviders) > 0 || len(input.ControlPlaneProviders) > 0 || - len(input.InfrastructureProviders) > 0 + len(input.InfrastructureProviders) > 0 || + len(input.IPAMProviders) > 0 || + len(input.RuntimeExtensionProviders) > 0 if !isCustomUpgrade { Expect(input.Contract).ToNot(BeEmpty(), "Invalid argument. input.Contract can't be empty when calling UpgradeManagementClusterAndWait without custom providers") } Expect(os.MkdirAll(input.LogFolder, 0750)).To(Succeed(), "Invalid argument. input.LogFolder can't be created for UpgradeManagementClusterAndWait") Upgrade(ctx, UpgradeInput{ - ClusterctlConfigPath: input.ClusterctlConfigPath, - ClusterctlVariables: input.ClusterctlVariables, - ClusterName: input.ClusterProxy.GetName(), - KubeconfigPath: input.ClusterProxy.GetKubeconfigPath(), - Contract: input.Contract, - CoreProvider: input.CoreProvider, - BootstrapProviders: input.BootstrapProviders, - ControlPlaneProviders: input.ControlPlaneProviders, - InfrastructureProviders: input.InfrastructureProviders, - LogFolder: input.LogFolder, + ClusterctlConfigPath: input.ClusterctlConfigPath, + ClusterctlVariables: input.ClusterctlVariables, + ClusterName: input.ClusterProxy.GetName(), + KubeconfigPath: input.ClusterProxy.GetKubeconfigPath(), + Contract: input.Contract, + CoreProvider: input.CoreProvider, + BootstrapProviders: input.BootstrapProviders, + ControlPlaneProviders: input.ControlPlaneProviders, + InfrastructureProviders: input.InfrastructureProviders, + IPAMProviders: input.IPAMProviders, + RuntimeExtensionProviders: input.RuntimeExtensionProviders, + LogFolder: input.LogFolder, }) client := input.ClusterProxy.GetClient()