@@ -120,8 +120,13 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
120
120
By ("Deploy Test Extension" )
121
121
testExtensionDeploymentTemplate , err := os .ReadFile (testExtensionPath ) //nolint:gosec
122
122
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.
123
127
testExtensionDeployment := strings .ReplaceAll (string (testExtensionDeploymentTemplate ), "${SERVICE_NAMESPACE}" , namespace .Name )
124
128
Expect (testExtensionDeployment ).ToNot (BeEmpty (), "Test Extension deployment manifest file should not be empty" )
129
+
125
130
Expect (input .BootstrapClusterProxy .Apply (ctx , []byte (testExtensionDeployment ), "--namespace" , namespace .Name )).To (Succeed ())
126
131
127
132
By ("Deploy Test Extension ExtensionConfig" )
@@ -151,6 +156,7 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
151
156
WaitForMachinePools : input .E2EConfig .GetIntervals (specName , "wait-machine-pool-nodes" ),
152
157
}, clusterResources )
153
158
159
+ // Upgrade the Cluster topology to run through an entire cluster lifecycle to test the lifecycle hooks.
154
160
By ("Upgrading the Cluster topology" )
155
161
framework .UpgradeClusterTopologyAndWaitForUpgrade (ctx , framework.UpgradeClusterTopologyAndWaitForUpgradeInput {
156
162
ClusterProxy : input .BootstrapClusterProxy ,
@@ -201,6 +207,10 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
201
207
})
202
208
}
203
209
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.
204
214
func extensionConfig (specName string , namespace * corev1.Namespace ) * runtimev1.ExtensionConfig {
205
215
return & runtimev1.ExtensionConfig {
206
216
ObjectMeta : metav1.ObjectMeta {
0 commit comments