Skip to content

Commit

Permalink
test: remove volume-mount-path-to-check e2e flag (#367)
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed Feb 8, 2022
1 parent 69e2890 commit da5aeea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ test_helm_chart() {
--create-namespace \
--wait
poll_webhook_readiness
# TODO(aramase) remove the volume mount path check after v0.8.0 is released
E2E_EXTRA_ARGS=-e2e.volume-mount-path-to-check=/var/run/secrets/tokens make test-e2e-run
make test-e2e-run

${HELM} upgrade --install workload-identity-webhook "${REPO_ROOT}/manifest_staging/charts/workload-identity-webhook" \
--set image.repository="${REGISTRY:-mcr.microsoft.com/oss/azure/workload-identity/webhook}" \
Expand Down
9 changes: 4 additions & 5 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import (
)

var (
arcCluster bool
tokenExchangeE2EImage string
proxyInitImage string
proxyImage string
volumeMountPathToCheck string
arcCluster bool
tokenExchangeE2EImage string
proxyInitImage string
proxyImage string

c *kubernetes.Clientset
coreNamespaces = []string{
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"os"
"testing"

"github.com/Azure/azure-workload-identity/pkg/webhook"

"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/config"
)
Expand All @@ -18,7 +16,6 @@ func init() {
flag.StringVar(&tokenExchangeE2EImage, "e2e.token-exchange-image", "aramase/msal-go:v0.6.0", "The image to use for token exchange tests")
flag.StringVar(&proxyInitImage, "e2e.proxy-init-image", "mcr.microsoft.com/oss/azure/workload-identity/proxy-init:v0.8.0", "The proxy-init image")
flag.StringVar(&proxyImage, "e2e.proxy-image", "mcr.microsoft.com/oss/azure/workload-identity/proxy:v0.8.0", "The proxy image")
flag.StringVar(&volumeMountPathToCheck, "e2e.volume-mount-path-to-check", webhook.TokenFileMountPath, "The volume mount path to check")
}

// handleFlags sets up all flags and parses the command line.
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func validateMutatedPod(f *framework.Framework, pod *corev1.Pod, skipContainers
found = true
gomega.Expect(volumeMount).To(gomega.Equal(corev1.VolumeMount{
Name: webhook.TokenFilePathName,
MountPath: volumeMountPathToCheck,
MountPath: webhook.TokenFileMountPath,
ReadOnly: true,
}))
break
Expand Down Expand Up @@ -285,7 +285,7 @@ func validateMutatedPod(f *framework.Framework, pod *corev1.Pod, skipContainers
if len(withoutSkipContainers) > 0 {
err := e2epod.WaitForPodNameRunningInNamespace(f.ClientSet, pod.Name, pod.Namespace)
framework.ExpectNoError(err, "failed to start pod %s", pod.Name)
_ = f.ExecCommandInContainer(pod.Name, withoutSkipContainers[0].Name, "cat", filepath.Join(volumeMountPathToCheck, webhook.TokenFilePathName))
_ = f.ExecCommandInContainer(pod.Name, withoutSkipContainers[0].Name, "cat", filepath.Join(webhook.TokenFileMountPath, webhook.TokenFilePathName))
}
}

Expand Down

0 comments on commit da5aeea

Please sign in to comment.