Skip to content

Commit a94fc08

Browse files
committed
test(e2e): allow image overrides via environment
1 parent ca03d7b commit a94fc08

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

test/e2e/e2e_suite_test.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ limitations under the License.
2020
package e2e
2121

2222
import (
23+
"os"
2324
"os/exec"
2425
"testing"
2526

@@ -35,6 +36,13 @@ const (
3536
helmCRDRelease = "imp-crds"
3637
)
3738

39+
func getenvOrDefault(name, fallback string) string {
40+
if v := os.Getenv(name); v != "" {
41+
return v
42+
}
43+
return fallback
44+
}
45+
3846
// Note: the Kind cluster itself is managed by the CI workflow (helm/kind-action@v1) or
3947
// must be created manually before running these tests locally:
4048
//
@@ -57,12 +65,17 @@ var _ = BeforeSuite(func() {
5765
Expect(err).NotTo(HaveOccurred(), "helm install imp-crds failed")
5866

5967
By("installing imp chart")
68+
operatorRepo := getenvOrDefault("IMP_E2E_OPERATOR_IMAGE_REPOSITORY", "local/imp-operator")
69+
operatorTag := getenvOrDefault("IMP_E2E_OPERATOR_IMAGE_TAG", "e2e")
70+
agentRepo := getenvOrDefault("IMP_E2E_AGENT_IMAGE_REPOSITORY", "local/imp-agent")
71+
agentTag := getenvOrDefault("IMP_E2E_AGENT_IMAGE_TAG", "e2e")
72+
6073
impCmd := exec.Command("helm", "install", helmRelease, "charts/imp",
6174
"--namespace", namespace,
62-
"--set", "operator.image.repository=local/imp-operator",
63-
"--set", "operator.image.tag=e2e",
64-
"--set", "agent.image.repository=local/imp-agent",
65-
"--set", "agent.image.tag=e2e",
75+
"--set", "operator.image.repository="+operatorRepo,
76+
"--set", "operator.image.tag="+operatorTag,
77+
"--set", "agent.image.repository="+agentRepo,
78+
"--set", "agent.image.tag="+agentTag,
6679
"--set", "agent.env.kernelPath=/var/lib/imp/vmlinux",
6780
"--set-string", "agent.nodeSelector.imp\\.dev/no-agent=true",
6881
"--set", "metrics.serviceMonitor.enabled=false",

0 commit comments

Comments
 (0)