diff --git a/test/helpers/cons.go b/test/helpers/cons.go index 83a6d8fa248b9..a028401ac5d6c 100644 --- a/test/helpers/cons.go +++ b/test/helpers/cons.go @@ -22,7 +22,7 @@ import ( k8sConst "github.com/cilium/cilium/pkg/k8s/apis/cilium.io" "github.com/cilium/cilium/pkg/versioncheck" - "github.com/cilium/cilium/test/ginkgo-ext" + ginkgoext "github.com/cilium/cilium/test/ginkgo-ext" ) var ( @@ -178,10 +178,6 @@ const ( CiliumDockerDaemonName = "cilium-docker" AgentDaemon = "cilium-agent" - GeneratedHTMLManifest = "html.yaml" - GeneratedServerManifest = "server.yaml" - GeneratedClientManifest = "client.yaml" - KubectlCreate = ResourceLifeCycleAction("create") KubectlDelete = ResourceLifeCycleAction("delete") KubectlApply = ResourceLifeCycleAction("apply") diff --git a/test/helpers/kubectl.go b/test/helpers/kubectl.go index 7ca7da1f20847..d201dec8bbc06 100644 --- a/test/helpers/kubectl.go +++ b/test/helpers/kubectl.go @@ -2642,16 +2642,6 @@ func (kub *Kubectl) CiliumEndpointsList(ctx context.Context, pod string) *CmdRes return kub.CiliumExecContext(ctx, pod, "cilium endpoint list -o json") } -// CiliumEndpointsStatus returns a mapping of a pod name to it is corresponding -// endpoint's status -func (kub *Kubectl) CiliumEndpointsStatus(pod string) map[string]string { - filter := `{range [*]}{@.status.external-identifiers.pod-name}{"="}{@.status.state}{"\n"}{end}` - ctx, cancel := context.WithTimeout(context.Background(), ShortCommandTimeout) - defer cancel() - return kub.CiliumExecContext(ctx, pod, fmt.Sprintf( - "cilium endpoint list -o jsonpath='%s'", filter)).KVOutput() -} - // CiliumEndpointIPv6 returns the IPv6 address of each endpoint which matches // the given endpoint selector. func (kub *Kubectl) CiliumEndpointIPv6(pod string, endpoint string) map[string]string { diff --git a/test/helpers/manifest_generator.go b/test/helpers/manifest_generator.go deleted file mode 100644 index 0873f12a4446a..0000000000000 --- a/test/helpers/manifest_generator.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2017 Authors of Cilium -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package helpers - -import ( - "bytes" - "io/ioutil" - "os" - "path" - "text/template" -) - -// ManifestValues wraps manifest index -type ManifestValues struct { - Index int -} - -// GenerateManifestForEndpoints generates k8s manifests that will create -// endpointCount Cilium endpoints when applied. -// 1/3 of endpoints are servers, the rest are clients. -// returns lastServer index -// Saves generated manifest to manifestPath, also returns it via string -func GenerateManifestForEndpoints(endpointCount int, manifestPath string) (string, int, error) { - configMapStr, err := ioutil.ReadFile(path.Join(K8sManifestBase, GeneratedHTMLManifest)) - if err != nil { - return "", 0, err - } - - serverTemplateStr, err := ioutil.ReadFile(path.Join(K8sManifestBase, GeneratedServerManifest)) - if err != nil { - return "", 0, err - } - serverTemplate, err := template.New("server").Parse(string(serverTemplateStr)) - if err != nil { - return "", 0, err - } - - clientTemplateStr, err := ioutil.ReadFile(path.Join(K8sManifestBase, GeneratedClientManifest)) - if err != nil { - return "", 0, err - } - clientTemplate, err := template.New("client").Parse(string(clientTemplateStr)) - if err != nil { - return "", 0, err - } - - separator := "\n---\n" - buf := new(bytes.Buffer) - buf.Write(configMapStr) - i := 0 - for ; i < endpointCount/3; i++ { - buf.WriteString(separator) - - vals := ManifestValues{i} - serverTemplate.Execute(buf, vals) - } - lastServer := i - - for ; i < endpointCount; i++ { - buf.WriteString(separator) - - vals := ManifestValues{i} - clientTemplate.Execute(buf, vals) - } - - result := buf.String() - ioutil.WriteFile(manifestPath, []byte(result), os.ModePerm) - - return result, lastServer, nil -} diff --git a/test/k8sT/manifests/client.yaml b/test/k8sT/manifests/client.yaml deleted file mode 100644 index 6dd61e0611b11..0000000000000 --- a/test/k8sT/manifests/client.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: app{{.Index}} - labels: - id: app{{.Index}} - zgroup: testapp -spec: - containers: - - name: app-frontend - image: docker.io/cilium/connectivity-container:v1.0 - imagePullPolicy: IfNotPresent - command: [ "sleep" ] - args: - - "1000h" diff --git a/test/k8sT/manifests/html.yaml b/test/k8sT/manifests/html.yaml deleted file mode 100644 index dd1cfbd777e7a..0000000000000 --- a/test/k8sT/manifests/html.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: html -data: - index.html: index diff --git a/test/k8sT/manifests/server.yaml b/test/k8sT/manifests/server.yaml deleted file mode 100644 index e7a071d63fa8b..0000000000000 --- a/test/k8sT/manifests/server.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: app{{.Index}}-service - labels: - zgroup: testapp -spec: - ports: - - port: 80 - selector: - id: app{{.Index}} ---- -apiVersion: v1 -kind: Pod -metadata: - name: app{{.Index}} - labels: - id: app{{.Index}} - zgroup: testapp -spec: - containers: - - name: web - image: docker.io/cilium/connectivity-container:v1.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - name: html-volume - mountPath: /var/www - volumes: - - name: html-volume - configMap: - name: html