@@ -11,22 +11,16 @@ import (
11
11
"encoding/base64"
12
12
"encoding/gob"
13
13
"flag"
14
- "fmt"
15
14
"os"
16
15
"path/filepath"
17
16
"slices"
18
17
"strings"
19
18
"testing"
20
- "time"
21
19
22
20
. "github.com/onsi/ginkgo/v2"
23
21
. "github.com/onsi/gomega"
24
- corev1 "k8s.io/api/core/v1"
25
22
storagev1 "k8s.io/api/storage/v1"
26
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
23
"k8s.io/apimachinery/pkg/runtime"
28
- "k8s.io/apimachinery/pkg/types"
29
- "k8s.io/apimachinery/pkg/util/yaml"
30
24
"k8s.io/klog/v2"
31
25
capie2e "sigs.k8s.io/cluster-api/test/e2e"
32
26
capie2eframework "sigs.k8s.io/cluster-api/test/framework"
@@ -116,39 +110,6 @@ var _ = SynchronizedBeforeSuite(func() []byte {
116
110
useExistingCluster ,
117
111
)
118
112
119
- By ("Overriding coreDNS resolver" )
120
- // override coredns resolver to 8.8.8.8 and restart coredns deployment
121
- // read the dns-override.yaml file
122
- filePath , _ := filepath .Abs ("../../hack/kind/dns-override.yaml" )
123
- yamlFile , err := os .ReadFile (filePath )
124
- Expect (err ).To (BeNil (), "Failed to read the dns-override.yaml file" )
125
-
126
- // decode the yaml file into a Kubernetes object
127
- decode := yaml .NewYAMLOrJSONDecoder (bytes .NewReader (yamlFile ), 4096 )
128
- configMap := & corev1.ConfigMap {}
129
- err = decode .Decode (& configMap )
130
- Expect (err ).To (BeNil (), "Failed to decode the yaml file into a Kubernetes object" )
131
-
132
- _ , err = bootstrapClusterProxy .GetClientSet ().
133
- CoreV1 ().
134
- ConfigMaps (configMap .GetNamespace ()).
135
- Update (context .Background (), configMap , metav1.UpdateOptions {})
136
- Expect (
137
- err ,
138
- ).To (BeNil (), "Failed to update the coredns deployment with the dns-override.yaml file" )
139
-
140
- timeNow := time .Now ().Format (time .RFC3339 )
141
- patch := fmt .Sprintf (
142
- `{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":%q}}}}}` ,
143
- timeNow ,
144
- )
145
-
146
- _ , err = bootstrapClusterProxy .GetClientSet ().
147
- AppsV1 ().
148
- Deployments ("kube-system" ).
149
- Patch (context .Background (), "coredns" , types .StrategicMergePatchType , []byte (patch ), metav1.PatchOptions {})
150
- Expect (err ).To (BeNil (), "Failed to restart the coredns deployment" )
151
-
152
113
By ("Initializing the bootstrap cluster" )
153
114
initBootstrapCluster (bootstrapClusterProxy , e2eConfig , clusterctlConfigPath , artifactFolder )
154
115
0 commit comments