Changes to e2e to accomodate client-go changes and RunKubectlInput

With client-go v1.18.0 there is a change where Signatures on methods
in generated clientsets, dynamic, metadata, and scale clients have been
modified to accept context.Context as a first argument.
Signatures of Create, Update, and Patch methods have been updated to accept
CreateOptions, UpdateOptions and PatchOptions respectively.
Signatures of Delete and DeleteCollection methods now accept DeleteOptions
by value instead of by reference

The framework.RunkubectlInput now accepts namespace as the first parameter
which is also accommodated with this PR.

Signed-off-by: Humble Chirammal hchiramm@redhat.com
This commit is contained in:
Humble Chirammal
2020-04-14 12:29:04 +05:30
committed by mergify[bot]
parent 60a394b397
commit 4c96ad3c85
7 changed files with 73 additions and 70 deletions

View File

@ -1,6 +1,7 @@
package e2e
import (
"context"
"strings"
. "github.com/onsi/gomega" // nolint
@ -21,7 +22,7 @@ var (
func deployVault(c kubernetes.Interface, deployTimeout int) {
// hack to make helm E2E pass as helm charts creates this configmap as part
// of cephcsi deployment
_, err := framework.RunKubectl("delete", "cm", "ceph-csi-encryption-kms-config", "--namespace", cephCSINamespace, "--ignore-not-found=true")
_, err := framework.RunKubectl(cephCSINamespace, "delete", "cm", "ceph-csi-encryption-kms-config", "--namespace", cephCSINamespace, "--ignore-not-found=true")
Expect(err).Should(BeNil())
createORDeleteVault("create")
@ -29,7 +30,7 @@ func deployVault(c kubernetes.Interface, deployTimeout int) {
LabelSelector: "app=vault",
}
pods, err := c.CoreV1().Pods(cephCSINamespace).List(opt)
pods, err := c.CoreV1().Pods(cephCSINamespace).List(context.TODO(), opt)
Expect(err).Should(BeNil())
Expect(len(pods.Items)).Should(Equal(1))
name := pods.Items[0].Name
@ -50,7 +51,7 @@ func createORDeleteVault(action string) {
data = strings.ReplaceAll(data, "vault.default", "vault."+cephCSINamespace)
data = strings.ReplaceAll(data, "value: default", "value: "+cephCSINamespace)
_, err = framework.RunKubectlInput(data, action, ns, "-f", "-")
_, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-")
if err != nil {
e2elog.Logf("failed to %s vault statefulset %v", action, err)
}
@ -59,7 +60,7 @@ func createORDeleteVault(action string) {
if err != nil {
e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultRBACPath, err)
}
_, err = framework.RunKubectlInput(data, action, ns, "-f", "-")
_, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-")
if err != nil {
e2elog.Logf("failed to %s vault statefulset %v", action, err)
}
@ -69,7 +70,7 @@ func createORDeleteVault(action string) {
e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultConfigPath, err)
}
data = strings.ReplaceAll(data, "default", cephCSINamespace)
_, err = framework.RunKubectlInput(data, action, ns, "-f", "-")
_, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-")
if err != nil {
e2elog.Logf("failed to %s vault config map %v", action, err)
}
@ -78,7 +79,7 @@ func createORDeleteVault(action string) {
if err != nil {
e2elog.Logf("failed to read content from %s %v", vaultExamplePath+vaultPSPPath, err)
}
_, err = framework.RunKubectlInput(data, action, ns, "-f", "-")
_, err = framework.RunKubectlInput(cephCSINamespace, data, action, ns, "-f", "-")
if err != nil {
e2elog.Logf("failed to %s vault psp %v", action, err)
}