diff --git a/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl1.yaml b/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl1.yaml index b60a3f8..4dc750a 100755 --- a/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl1.yaml +++ b/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl1.yaml @@ -80,7 +80,6 @@ spec: - name: LAUNCHER_CONTAINERLAB_TIMEOUT - name: LAUNCHER_PRIVILEGED value: "true" - image: 172.31.254.11/clabernetes-launcher:dev-latest imagePullPolicy: IfNotPresent name: srl1 ports: diff --git a/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl2.yaml b/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl2.yaml index e0aa44a..423ab74 100755 --- a/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl2.yaml +++ b/e2e/topology/basic/test-fixtures/golden/20-deployment.topology-basic-srl2.yaml @@ -79,7 +79,6 @@ spec: - name: LAUNCHER_CONTAINERLAB_TIMEOUT - name: LAUNCHER_PRIVILEGED value: "true" - image: 172.31.254.11/clabernetes-launcher:dev-latest imagePullPolicy: IfNotPresent name: srl2 ports: diff --git a/e2e/topology/basic/topology_basic_test.go b/e2e/topology/basic/topology_basic_test.go index 29af3a2..3462f51 100644 --- a/e2e/topology/basic/topology_basic_test.go +++ b/e2e/topology/basic/topology_basic_test.go @@ -96,12 +96,16 @@ func TestContainerlabBasic(t *testing.T) { }, "deployment": { { - Name: fmt.Sprintf("%s-srl1", testName), - NormalizeFuncs: []func(t *testing.T, objectData []byte) []byte{}, + Name: fmt.Sprintf("%s-srl1", testName), + NormalizeFuncs: []func(t *testing.T, objectData []byte) []byte{ + clabernetestesthelper.NormalizeDeployment, + }, }, { - Name: fmt.Sprintf("%s-srl2", testName), - NormalizeFuncs: []func(t *testing.T, objectData []byte) []byte{}, + Name: fmt.Sprintf("%s-srl2", testName), + NormalizeFuncs: []func(t *testing.T, objectData []byte) []byte{ + clabernetestesthelper.NormalizeDeployment, + }, }, }, "connectivity": { diff --git a/testhelper/kubernetes.go b/testhelper/kubernetes.go index db1d7f2..e61c984 100644 --- a/testhelper/kubernetes.go +++ b/testhelper/kubernetes.go @@ -127,6 +127,18 @@ func NormalizeFabricService(t *testing.T, objectData []byte) []byte { return objectData } +// NormalizeDeployment normalizes a deployment by removing fields that may change between ci and +// local or other folks machines/clusters (like image/registry)-- so we can compare results more +// easily. +func NormalizeDeployment(t *testing.T, objectData []byte) []byte { + t.Helper() + + // we dont care about testing that the image was set "right" really, so just remove it + objectData = YQCommand(t, objectData, "del(.spec.template.spec.containers[0].image)") + + return objectData +} + // NormalizeConnectivity normalizes a connectivity cr between ci and local or other folks // machines/clusters -- so we can compare results more easily. For now this is just replacing the // namespace in the destinations since those will be random(ish) per test run.