Skip to content

Commit

Permalink
test: Remove NodeCleanMetadata
Browse files Browse the repository at this point in the history
This seems useless and only prolongs test duration

Signed-off-by: Thomas Graf <thomas@cilium.io>
  • Loading branch information
tgraf committed May 18, 2020
1 parent 1d618db commit a2ff935
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
22 changes: 0 additions & 22 deletions test/helpers/kubectl.go
Expand Up @@ -30,7 +30,6 @@ import (
"time"

"github.com/cilium/cilium/api/v1/models"
"github.com/cilium/cilium/pkg/annotation"
cnpv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
"github.com/cilium/cilium/test/config"
ginkgoext "github.com/cilium/cilium/test/ginkgo-ext"
Expand Down Expand Up @@ -1038,27 +1037,6 @@ func (kub *Kubectl) PprofReport() {
}
}

// NodeCleanMetadata annotates each node in the Kubernetes cluster with the
// annotation.V4CIDRName and annotation.V6CIDRName annotations. It returns an
// error if the nodes cannot be retrieved via the Kubernetes API.
func (kub *Kubectl) NodeCleanMetadata() error {
metadata := []string{
annotation.V4CIDRName,
annotation.V6CIDRName,
}

data := kub.ExecShort(fmt.Sprintf("%s get nodes -o jsonpath='{.items[*].metadata.name}'", KubectlCmd))
if !data.WasSuccessful() {
return fmt.Errorf("could not get nodes via %s: %s", KubectlCmd, data.CombineOutput())
}
for _, node := range strings.Split(data.Output().String(), " ") {
for _, label := range metadata {
kub.ExecShort(fmt.Sprintf("%s annotate --overwrite nodes %s %s=''", KubectlCmd, node, label))
}
}
return nil
}

// NamespaceCreate creates a new Kubernetes namespace with the given name
func (kub *Kubectl) NamespaceCreate(name string) *CmdRes {
ginkgoext.By("Creating namespace %s", name)
Expand Down
4 changes: 0 additions & 4 deletions test/k8sT/Conformance.go
Expand Up @@ -32,10 +32,6 @@ var _ = Describe("K8sConformance", func() {
ciliumFilename = helpers.TimestampFilename("cilium.yaml")
})

BeforeEach(func() {
kubectl.NodeCleanMetadata()
})

AfterEach(func() {
kubectl.Delete(connectivityCheckYaml)
kubectl.DeleteCiliumDS()
Expand Down
4 changes: 0 additions & 4 deletions test/k8sT/DatapathConfiguration.go
Expand Up @@ -50,10 +50,6 @@ var _ = Describe("K8sDatapathConfig", func() {
Expect(err).Should(BeNil(), "Cannot determine default iface")
})

BeforeEach(func() {
kubectl.NodeCleanMetadata()
})

AfterEach(func() {
deploymentManager.DeleteAll()
// FIXME(tgraf) Is this really needed?
Expand Down
4 changes: 0 additions & 4 deletions test/k8sT/Identity.go
Expand Up @@ -32,10 +32,6 @@ var _ = Describe("K8sIdentity", func() {
ciliumFilename = helpers.TimestampFilename("cilium.yaml")
})

BeforeEach(func() {
kubectl.NodeCleanMetadata()
})

AfterEach(func() {
kubectl.DeleteCiliumDS()
ExpectAllPodsTerminated(kubectl)
Expand Down

0 comments on commit a2ff935

Please sign in to comment.