diff --git a/operator/controller/src/main/resources/application.properties b/operator/controller/src/main/resources/application.properties index ec19eed74a..d39f477810 100644 --- a/operator/controller/src/main/resources/application.properties +++ b/operator/controller/src/main/resources/application.properties @@ -55,8 +55,6 @@ registry.version=${project.version} %test.registry.ui.image=quay.io/apicurio/apicurio-registry-ui:latest-snapshot %dev.registry.ui.image=quay.io/apicurio/apicurio-registry-ui:latest-snapshot -# Maven property -%test.test.operator.project-version=${project.version} # Maven property %test.test.operator.project-root=${projectRoot} diff --git a/operator/controller/src/test/java/io/apicurio/registry/operator/unit/PodTemplateSpecTest.java b/operator/controller/src/test/java/io/apicurio/registry/operator/unit/PodTemplateSpecTest.java index 7e0876ddf4..d43a4a64b7 100644 --- a/operator/controller/src/test/java/io/apicurio/registry/operator/unit/PodTemplateSpecTest.java +++ b/operator/controller/src/test/java/io/apicurio/registry/operator/unit/PodTemplateSpecTest.java @@ -8,6 +8,8 @@ import io.apicurio.registry.operator.resource.ResourceFactory; import io.apicurio.registry.operator.unit.PodTemplateSpecArgumentProviders.*; import io.fabric8.kubernetes.api.model.ObjectMeta; +import io.fabric8.kubernetes.api.model.PodTemplateSpec; +import org.eclipse.microprofile.config.ConfigProvider; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; import org.slf4j.Logger; @@ -27,6 +29,7 @@ void testAppPositive(TestCase testCase) { var primary = getPrimary(); primary.getSpec().getApp().setPodTemplateSpec(testCase.getSpec()); var expected = ResourceFactory.INSTANCE.getDefaultAppDeployment(primary).getSpec().getTemplate(); + preprocessTestCaseExpected(testCase.getExpected()); // spotless:off assertThat(expected) .usingRecursiveComparison() @@ -57,6 +60,7 @@ void testUIPositive(TestCase testCase) { var primary = getPrimary(); primary.getSpec().getUi().setPodTemplateSpec(testCase.getSpec()); var expected = ResourceFactory.INSTANCE.getDefaultUIDeployment(primary).getSpec().getTemplate(); + preprocessTestCaseExpected(testCase.getExpected()); // spotless:off assertThat(expected) .usingRecursiveComparison() @@ -90,4 +94,9 @@ private static ApicurioRegistry3 getPrimary() { primary.getSpec().setUi(new ApicurioRegistry3SpecUI()); return primary; } + + private static void preprocessTestCaseExpected(PodTemplateSpec expected) { + expected.getMetadata().getLabels().computeIfPresent("app.kubernetes.io/version", + (k, v) -> ConfigProvider.getConfig().getValue("registry.version", String.class)); + } } diff --git a/operator/controller/src/test/resources/podtemplatespec-test-cases-app-positive.yaml b/operator/controller/src/test/resources/podtemplatespec-test-cases-app-positive.yaml index a1c20fb11e..c8fc613454 100644 --- a/operator/controller/src/test/resources/podtemplatespec-test-cases-app-positive.yaml +++ b/operator/controller/src/test/resources/podtemplatespec-test-cases-app-positive.yaml @@ -6,7 +6,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -50,7 +50,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -95,7 +95,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -137,7 +137,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -184,7 +184,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -234,7 +234,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -279,7 +279,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -328,7 +328,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -382,7 +382,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -432,7 +432,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -476,7 +476,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -514,7 +514,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app @@ -554,7 +554,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: app diff --git a/operator/controller/src/test/resources/podtemplatespec-test-cases-ui-positive.yaml b/operator/controller/src/test/resources/podtemplatespec-test-cases-ui-positive.yaml index 8842ffc299..4133ec6a5e 100644 --- a/operator/controller/src/test/resources/podtemplatespec-test-cases-ui-positive.yaml +++ b/operator/controller/src/test/resources/podtemplatespec-test-cases-ui-positive.yaml @@ -6,7 +6,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -50,7 +50,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -95,7 +95,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -137,7 +137,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -184,7 +184,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -234,7 +234,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -279,7 +279,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -328,7 +328,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -382,7 +382,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -432,7 +432,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -476,7 +476,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -514,7 +514,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui @@ -554,7 +554,7 @@ cases: metadata: labels: app.kubernetes.io/name: apicurio-registry - app.kubernetes.io/version: 1.0.0 + app.kubernetes.io/version: placeholder app.kubernetes.io/instance: test app.kubernetes.io/part-of: apicurio-registry app.kubernetes.io/component: ui diff --git a/operator/olm-tests/src/test/java/io/apicurio/registry/operator/it/OLMITBase.java b/operator/olm-tests/src/test/java/io/apicurio/registry/operator/it/OLMITBase.java index dbbd870667..a0fa48342d 100644 --- a/operator/olm-tests/src/test/java/io/apicurio/registry/operator/it/OLMITBase.java +++ b/operator/olm-tests/src/test/java/io/apicurio/registry/operator/it/OLMITBase.java @@ -20,7 +20,7 @@ public abstract class OLMITBase { private static final Logger log = LoggerFactory.getLogger(OLMITBase.class); - public static final String PROJECT_VERSION_PROP = "test.operator.project-version"; + public static final String PROJECT_VERSION_PROP = "registry.version"; public static final String PROJECT_ROOT_PROP = "test.operator.project-root"; public static final String CATALOG_IMAGE_PROP = "test.operator.catalog-image";