Skip to content

Commit 072c264

Browse files
Update examples
1 parent 5d15d05 commit 072c264

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

hack/examples/patches/nutanix/ccm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- op: "add"
55
path: "/spec/topology/variables/0/value/addons/ccm"
66
value:
7+
strategy: HelmAddon
78
credentials:
89
secretRef:
910
name: ${CLUSTER_NAME}-pc-creds

test/e2e/e2e_suite_test.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import (
1212
"encoding/gob"
1313
"flag"
1414
"fmt"
15-
corev1 "k8s.io/api/core/v1"
16-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
17-
"k8s.io/apimachinery/pkg/types"
18-
"k8s.io/apimachinery/pkg/util/yaml"
1915
"os"
2016
"path/filepath"
2117
"slices"
@@ -25,8 +21,12 @@ import (
2521

2622
. "github.com/onsi/ginkgo/v2"
2723
. "github.com/onsi/gomega"
24+
corev1 "k8s.io/api/core/v1"
2825
storagev1 "k8s.io/api/storage/v1"
26+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2927
"k8s.io/apimachinery/pkg/runtime"
28+
"k8s.io/apimachinery/pkg/types"
29+
"k8s.io/apimachinery/pkg/util/yaml"
3030
"k8s.io/klog/v2"
3131
capie2e "sigs.k8s.io/cluster-api/test/e2e"
3232
capie2eframework "sigs.k8s.io/cluster-api/test/framework"
@@ -130,13 +130,24 @@ var _ = SynchronizedBeforeSuite(func() []byte {
130130
err = decode.Decode(&configMap)
131131
Expect(err).To(BeNil(), "Failed to decode the yaml file into a Kubernetes object")
132132

133-
_, err = bootstrapClusterProxy.GetClientSet().CoreV1().ConfigMaps(configMap.GetNamespace()).Update(context.Background(), configMap, metav1.UpdateOptions{})
134-
Expect(err).To(BeNil(), "Failed to update the coredns deployment with the dns-override.yaml file")
133+
_, err = bootstrapClusterProxy.GetClientSet().
134+
CoreV1().
135+
ConfigMaps(configMap.GetNamespace()).
136+
Update(context.Background(), configMap, metav1.UpdateOptions{})
137+
Expect(
138+
err,
139+
).To(BeNil(), "Failed to update the coredns deployment with the dns-override.yaml file")
135140

136141
timeNow := time.Now().Format(time.RFC3339)
137-
patch := fmt.Sprintf(`{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":"%s"}}}}}`, timeNow)
142+
patch := fmt.Sprintf(
143+
`{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":%q}}}}}`,
144+
timeNow,
145+
)
138146

139-
_, err = bootstrapClusterProxy.GetClientSet().AppsV1().Deployments("kube-system").Patch(context.Background(), "coredns", types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{})
147+
_, err = bootstrapClusterProxy.GetClientSet().
148+
AppsV1().
149+
Deployments("kube-system").
150+
Patch(context.Background(), "coredns", types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{})
140151
Expect(err).To(BeNil(), "Failed to restart the coredns deployment")
141152

142153
By("Initializing the bootstrap cluster")
@@ -268,7 +279,6 @@ func setupBootstrapCluster(
268279
Expect(
269280
kubeconfigPath,
270281
).To(BeAnExistingFile(), "Failed to get the kubeconfig file for the bootstrap cluster")
271-
272282
} else {
273283
// Loading image for already created cluster
274284
imagesInput := capibootstrap.LoadImagesToKindClusterInput{

0 commit comments

Comments
 (0)