Skip to content

Commit 747d79e

Browse files
build(e2e): Remove Kind DNS resolver override (#178)
We no longer need this override to get the e2e running
1 parent 30b270d commit 747d79e

File tree

2 files changed

+4
-72
lines changed

2 files changed

+4
-72
lines changed

hack/kind/dns-override.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/e2e/e2e_suite_test.go

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,21 @@
33
package e2e
44

55
import (
6-
"bytes"
7-
"context"
86
"fmt"
9-
"os"
10-
"path/filepath"
11-
"strings"
12-
"testing"
13-
"time"
14-
157
. "github.com/onsi/ginkgo/v2"
168
. "github.com/onsi/gomega"
17-
corev1 "k8s.io/api/core/v1"
189
storagev1 "k8s.io/api/storage/v1"
1910
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2011
"k8s.io/apimachinery/pkg/runtime"
21-
"k8s.io/apimachinery/pkg/types"
22-
"k8s.io/apimachinery/pkg/util/yaml"
12+
"os"
13+
"path/filepath"
2314
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2415
"sigs.k8s.io/cluster-api/test/framework"
2516
"sigs.k8s.io/cluster-api/test/framework/bootstrap"
2617
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
2718
"sigs.k8s.io/cluster-api/test/framework/ginkgoextensions"
19+
"strings"
20+
"testing"
2821
)
2922

3023
func TestE2E(t *testing.T) {
@@ -69,39 +62,6 @@ var _ = SynchronizedBeforeSuite(func() []byte {
6962
By("Setting up the bootstrap cluster")
7063
bootstrapClusterProvider, bootstrapClusterProxy = setupBootstrapCluster(e2eConfig, scheme, useExistingCluster)
7164

72-
By("Overriding coreDNS resolver")
73-
// override coredns resolver to 8.8.8.8 and restart coredns deployment
74-
// read the dns-override.yaml file
75-
filePath, _ := filepath.Abs("../../hack/kind/dns-override.yaml")
76-
yamlFile, err := os.ReadFile(filePath)
77-
Expect(err).To(BeNil(), "Failed to read the dns-override.yaml file")
78-
79-
// decode the yaml file into a Kubernetes object
80-
decode := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(yamlFile), 4096)
81-
configMap := &corev1.ConfigMap{}
82-
err = decode.Decode(&configMap)
83-
Expect(err).To(BeNil(), "Failed to decode the yaml file into a Kubernetes object")
84-
85-
_, err = bootstrapClusterProxy.GetClientSet().
86-
CoreV1().
87-
ConfigMaps(configMap.GetNamespace()).
88-
Update(context.Background(), configMap, metav1.UpdateOptions{})
89-
Expect(
90-
err,
91-
).To(BeNil(), "Failed to update the coredns deployment with the dns-override.yaml file")
92-
93-
timeNow := time.Now().Format(time.RFC3339)
94-
patch := fmt.Sprintf(
95-
`{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":%q}}}}}`,
96-
timeNow,
97-
)
98-
99-
_, err = bootstrapClusterProxy.GetClientSet().
100-
AppsV1().
101-
Deployments("kube-system").
102-
Patch(context.Background(), "coredns", types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{})
103-
Expect(err).To(BeNil(), "Failed to restart the coredns deployment")
104-
10565
By("Initializing the bootstrap cluster")
10666
initBootstrapCluster(bootstrapClusterProxy, e2eConfig, clusterctlConfigPath, artifactFolder)
10767

0 commit comments

Comments
 (0)