Skip to content

Commit 3f8265a

Browse files
committed
review fixes
1 parent d0d277e commit 3f8265a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
120120
By("Deploy Test Extension")
121121
testExtensionDeploymentTemplate, err := os.ReadFile(testExtensionPath) //nolint:gosec
122122
Expect(err).ToNot(HaveOccurred(), "Failed to read the extension config deployment manifest file")
123+
124+
// Set the SERVICE_NAMESPACE, which is used in the cert-manager Certificate CR.
125+
// We have to dynamically set the namespace here, because it depends on the test run and thus
126+
// cannot be set when rendering the test extension YAML with kustomize.
123127
testExtensionDeployment := strings.ReplaceAll(string(testExtensionDeploymentTemplate), "${SERVICE_NAMESPACE}", namespace.Name)
124128
Expect(testExtensionDeployment).ToNot(BeEmpty(), "Test Extension deployment manifest file should not be empty")
129+
125130
Expect(input.BootstrapClusterProxy.Apply(ctx, []byte(testExtensionDeployment), "--namespace", namespace.Name)).To(Succeed())
126131

127132
By("Deploy Test Extension ExtensionConfig")
@@ -151,6 +156,7 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
151156
WaitForMachinePools: input.E2EConfig.GetIntervals(specName, "wait-machine-pool-nodes"),
152157
}, clusterResources)
153158

159+
// Upgrade the Cluster topology to run through an entire cluster lifecycle to test the lifecycle hooks.
154160
By("Upgrading the Cluster topology")
155161
framework.UpgradeClusterTopologyAndWaitForUpgrade(ctx, framework.UpgradeClusterTopologyAndWaitForUpgradeInput{
156162
ClusterProxy: input.BootstrapClusterProxy,
@@ -201,6 +207,10 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
201207
})
202208
}
203209

210+
// extensionConfig generates an ExtensionConfig.
211+
// We make sure this cluster-wide object does not conflict with others by using a random generated
212+
// name and a NamespaceSelector selecting on the namespace of the current test.
213+
// Thus, this object is "namespaced" to the current test even though it's a cluster-wide object.
204214
func extensionConfig(specName string, namespace *corev1.Namespace) *runtimev1.ExtensionConfig {
205215
return &runtimev1.ExtensionConfig{
206216
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)