diff --git a/docs/docs/schema/defaults.json b/docs/docs/schema/defaults.json index ae4af6582..77ceed301 100644 --- a/docs/docs/schema/defaults.json +++ b/docs/docs/schema/defaults.json @@ -920,6 +920,13 @@ "additionalProperties": true, "description": "Settings specific to producers.", "properties": { + "imageTag": { + "default": "latest", + "description": "Docker image tag of the streams-bootstrap app.", + "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", + "title": "Imagetag", + "type": "string" + }, "nameOverride": { "anyOf": [ { @@ -1273,6 +1280,13 @@ "default": null, "description": "Kubernetes event-driven autoscaling config" }, + "imageTag": { + "default": "latest", + "description": "Docker image tag of the streams-bootstrap app.", + "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", + "title": "Imagetag", + "type": "string" + }, "nameOverride": { "anyOf": [ { @@ -1328,10 +1342,10 @@ "app": { "allOf": [ { - "$ref": "#/$defs/HelmAppValues" + "$ref": "#/$defs/StreamsBootstrapValues" } ], - "description": "Helm app values" + "description": "streams-bootstrap app values" }, "from": { "anyOf": [ @@ -1409,12 +1423,40 @@ }, "required": [ "name", - "namespace", - "app" + "namespace" ], "title": "StreamsBootstrap", "type": "object" }, + "StreamsBootstrapValues": { + "additionalProperties": true, + "description": "Base value class for all streams bootstrap related components.", + "properties": { + "imageTag": { + "default": "latest", + "description": "Docker image tag of the streams-bootstrap app.", + "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", + "title": "Imagetag", + "type": "string" + }, + "nameOverride": { + "anyOf": [ + { + "maxLength": 63, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Helm chart name override, assigned automatically", + "title": "Nameoverride" + } + }, + "title": "StreamsBootstrapValues", + "type": "object" + }, "StreamsConfig": { "additionalProperties": true, "description": "Streams Bootstrap streams section.", diff --git a/docs/docs/schema/pipeline.json b/docs/docs/schema/pipeline.json index ea33470b3..d8c953c82 100644 --- a/docs/docs/schema/pipeline.json +++ b/docs/docs/schema/pipeline.json @@ -588,6 +588,13 @@ "additionalProperties": true, "description": "Settings specific to producers.", "properties": { + "imageTag": { + "default": "latest", + "description": "Docker image tag of the streams-bootstrap app.", + "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", + "title": "Imagetag", + "type": "string" + }, "nameOverride": { "anyOf": [ { @@ -941,6 +948,13 @@ "default": null, "description": "Kubernetes event-driven autoscaling config" }, + "imageTag": { + "default": "latest", + "description": "Docker image tag of the streams-bootstrap app.", + "pattern": "^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$", + "title": "Imagetag", + "type": "string" + }, "nameOverride": { "anyOf": [ { diff --git a/kpops/components/streams_bootstrap/__init__.py b/kpops/components/streams_bootstrap/__init__.py index 1b02b091b..c6c329b85 100644 --- a/kpops/components/streams_bootstrap/__init__.py +++ b/kpops/components/streams_bootstrap/__init__.py @@ -1,26 +1,61 @@ +from __future__ import annotations + +import logging from abc import ABC +from typing import TYPE_CHECKING +import pydantic from pydantic import Field from kpops.component_handlers.helm_wrapper.model import HelmRepoConfig -from kpops.components.base_components.helm_app import HelmApp +from kpops.components.base_components.helm_app import HelmApp, HelmAppValues from kpops.utils.docstring import describe_attr +if TYPE_CHECKING: + try: + from typing import Self # pyright: ignore[reportAttributeAccessIssue] + except ImportError: + from typing_extensions import Self + STREAMS_BOOTSTRAP_HELM_REPO = HelmRepoConfig( repository_name="bakdata-streams-bootstrap", url="https://bakdata.github.io/streams-bootstrap/", ) STREAMS_BOOTSTRAP_VERSION = "2.9.0" +log = logging.getLogger("StreamsBootstrap") + +# Source of the pattern: https://kubernetes.io/docs/concepts/containers/images/#image-names +IMAGE_TAG_PATTERN = r"^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$" + + +class StreamsBootstrapValues(HelmAppValues): + """Base value class for all streams bootstrap related components. + + :param image_tag: Docker image tag of the streams-bootstrap app. + """ + + image_tag: str = Field( + default="latest", + pattern=IMAGE_TAG_PATTERN, + description=describe_attr("image_tag", __doc__), + ) + class StreamsBootstrap(HelmApp, ABC): """Base for components with a streams-bootstrap Helm chart. + :param app: streams-bootstrap app values :param repo_config: Configuration of the Helm chart repo to be used for deploying the component, defaults to streams-bootstrap Helm repo :param version: Helm chart version, defaults to "2.9.0" """ + app: StreamsBootstrapValues = Field( + default_factory=StreamsBootstrapValues, + description=describe_attr("app", __doc__), + ) + repo_config: HelmRepoConfig = Field( default=STREAMS_BOOTSTRAP_HELM_REPO, description=describe_attr("repo_config", __doc__), @@ -29,3 +64,11 @@ class StreamsBootstrap(HelmApp, ABC): default=STREAMS_BOOTSTRAP_VERSION, description=describe_attr("version", __doc__), ) + + @pydantic.model_validator(mode="after") + def warning_for_latest_image_tag(self) -> Self: + if self.validate_ and self.app.image_tag == "latest": + log.warning( + f"The image tag for component '{self.name}' is set or defaulted to 'latest'. Please, consider providing a stable image tag." + ) + return self diff --git a/kpops/components/streams_bootstrap/producer/model.py b/kpops/components/streams_bootstrap/producer/model.py index caef8d29d..2dc3b5927 100644 --- a/kpops/components/streams_bootstrap/producer/model.py +++ b/kpops/components/streams_bootstrap/producer/model.py @@ -4,6 +4,7 @@ KafkaAppValues, KafkaStreamsConfig, ) +from kpops.components.streams_bootstrap import StreamsBootstrapValues from kpops.utils.docstring import describe_attr @@ -11,7 +12,7 @@ class ProducerStreamsConfig(KafkaStreamsConfig): """Kafka Streams settings specific to Producer.""" -class ProducerAppValues(KafkaAppValues): +class ProducerAppValues(StreamsBootstrapValues, KafkaAppValues): """Settings specific to producers. :param streams: Kafka Streams settings diff --git a/kpops/components/streams_bootstrap/streams/model.py b/kpops/components/streams_bootstrap/streams/model.py index 04f95b54b..1bffb84c6 100644 --- a/kpops/components/streams_bootstrap/streams/model.py +++ b/kpops/components/streams_bootstrap/streams/model.py @@ -11,6 +11,7 @@ KafkaStreamsConfig, ) from kpops.components.base_components.models.topic import KafkaTopic, KafkaTopicStr +from kpops.components.streams_bootstrap import StreamsBootstrapValues from kpops.utils.docstring import describe_attr from kpops.utils.pydantic import ( CamelCaseConfigModel, @@ -237,7 +238,7 @@ def validate_mandatory_fields_are_set( return self -class StreamsAppValues(KafkaAppValues): +class StreamsAppValues(StreamsBootstrapValues, KafkaAppValues): """streams-bootstrap app configurations. The attributes correspond to keys and values that are used as values for the streams bootstrap helm chart. diff --git a/tests/components/test_kafka_sink_connector.py b/tests/components/test_kafka_sink_connector.py index 51b30a61d..1b98e4ac4 100644 --- a/tests/components/test_kafka_sink_connector.py +++ b/tests/components/test_kafka_sink_connector.py @@ -107,14 +107,6 @@ def test_connector_config_parsing( handlers: ComponentHandlers, connector_config: KafkaConnectorConfig, ): - connector = KafkaSinkConnector( - name=CONNECTOR_NAME, - config=config, - handlers=handlers, - app=connector_config, - resetter_namespace=RESETTER_NAMESPACE, - ) - topic_pattern = ".*" connector = KafkaSinkConnector( name=CONNECTOR_NAME, diff --git a/tests/components/test_streams_bootstrap.py b/tests/components/test_streams_bootstrap.py index a82fca8a9..3ece4612d 100644 --- a/tests/components/test_streams_bootstrap.py +++ b/tests/components/test_streams_bootstrap.py @@ -1,6 +1,8 @@ +import re from unittest.mock import MagicMock import pytest +from pydantic import ValidationError from pytest_mock import MockerFixture from kpops.component_handlers import ComponentHandlers @@ -10,7 +12,7 @@ HelmUpgradeInstallFlags, ) from kpops.component_handlers.helm_wrapper.utils import create_helm_release_name -from kpops.components.streams_bootstrap import StreamsBootstrap +from kpops.components.streams_bootstrap import StreamsBootstrap, StreamsBootstrapValues from kpops.config import KpopsConfig from tests.components import PIPELINE_BASE_DIR @@ -48,6 +50,7 @@ def test_default_configs(self, config: KpopsConfig, handlers: ComponentHandlers) ) assert streams_bootstrap.version == "2.9.0" assert streams_bootstrap.namespace == "test-namespace" + assert streams_bootstrap.app.image_tag == "latest" @pytest.mark.asyncio() async def test_should_deploy_streams_bootstrap_app( @@ -63,6 +66,7 @@ async def test_should_deploy_streams_bootstrap_app( **{ "namespace": "test-namespace", "app": { + "imageTag": "1.0.0", "streams": { "outputTopic": "test", "brokers": "fake-broker:9092", @@ -94,6 +98,7 @@ async def test_should_deploy_streams_bootstrap_app( "test-namespace", { "nameOverride": "${pipeline.name}-example-name", + "imageTag": "1.0.0", "streams": { "brokers": "fake-broker:9092", "outputTopic": "test", @@ -101,3 +106,21 @@ async def test_should_deploy_streams_bootstrap_app( }, HelmUpgradeInstallFlags(version="1.2.3"), ) + + @pytest.mark.asyncio() + async def test_should_raise_validation_error_for_invalid_image_tag( + self, + config: KpopsConfig, + handlers: ComponentHandlers, + ): + with pytest.raises( + ValidationError, + match=re.escape( + "1 validation error for StreamsBootstrapValues\nimageTag\n String should match pattern '^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$'" + ), + ): + StreamsBootstrapValues( + **{ + "imageTag": "invalid image tag!", + } + ) diff --git a/tests/pipeline/resources/resetter_values/defaults.yaml b/tests/pipeline/resources/resetter_values/defaults.yaml index 550c9c729..950ed4969 100644 --- a/tests/pipeline/resources/resetter_values/defaults.yaml +++ b/tests/pipeline/resources/resetter_values/defaults.yaml @@ -9,3 +9,5 @@ helm-app: kafka-sink-connector: app: "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector" + resetter_values: + imageTag: override-default-image-tag diff --git a/tests/pipeline/snapshots/test_generate/test_default_config/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_default_config/pipeline.yaml index cbd0e251e..4549c6209 100644 --- a/tests/pipeline/snapshots/test_generate/test_default_config/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_default_config/pipeline.yaml @@ -1,5 +1,6 @@ - _cleaner: app: + imageTag: latest resources: limits: memory: 2G @@ -21,6 +22,7 @@ type: producer-app-cleaner version: 2.9.0 app: + imageTag: latest resources: limits: memory: 2G @@ -50,6 +52,7 @@ - _cleaner: app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: @@ -77,6 +80,7 @@ version: 2.9.0 app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: diff --git a/tests/pipeline/snapshots/test_generate/test_inflate_pipeline/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_inflate_pipeline/pipeline.yaml index e5e003376..1040139c3 100644 --- a/tests/pipeline/snapshots/test_generate/test_inflate_pipeline/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_inflate_pipeline/pipeline.yaml @@ -64,6 +64,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -105,6 +106,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -293,6 +295,7 @@ type: kafka-sink-connector - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -317,6 +320,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/snapshots/test_generate/test_kafka_connect_sink_weave_from_topics/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_kafka_connect_sink_weave_from_topics/pipeline.yaml index bb569e772..e1dd399cd 100644 --- a/tests/pipeline/snapshots/test_generate/test_kafka_connect_sink_weave_from_topics/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_kafka_connect_sink_weave_from_topics/pipeline.yaml @@ -1,6 +1,7 @@ - _cleaner: app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false @@ -26,6 +27,7 @@ version: 2.4.2 app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/snapshots/test_generate/test_load_pipeline/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_load_pipeline/pipeline.yaml index 87a88601c..d49fa57d2 100644 --- a/tests/pipeline/snapshots/test_generate/test_load_pipeline/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_load_pipeline/pipeline.yaml @@ -64,6 +64,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -105,6 +106,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: diff --git a/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_folder_path/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_folder_path/pipeline.yaml index 2787d7444..42cd958d5 100644 --- a/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_folder_path/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_folder_path/pipeline.yaml @@ -65,6 +65,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -104,6 +105,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: diff --git a/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_multiple_pipeline_paths/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_multiple_pipeline_paths/pipeline.yaml index 2787d7444..42cd958d5 100644 --- a/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_multiple_pipeline_paths/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_load_pipeline_with_multiple_pipeline_paths/pipeline.yaml @@ -65,6 +65,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -104,6 +105,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: diff --git a/tests/pipeline/snapshots/test_generate/test_model_serialization/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_model_serialization/pipeline.yaml index 02e06ff34..9e85d9e01 100644 --- a/tests/pipeline/snapshots/test_generate/test_model_serialization/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_model_serialization/pipeline.yaml @@ -1,5 +1,6 @@ - _cleaner: app: + imageTag: latest streams: brokers: test outputTopic: out @@ -19,6 +20,7 @@ type: producer-app-cleaner version: 2.4.2 app: + imageTag: latest streams: brokers: test outputTopic: out diff --git a/tests/pipeline/snapshots/test_generate/test_no_input_topic/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_no_input_topic/pipeline.yaml index a77aea9be..3c57c8eb1 100644 --- a/tests/pipeline/snapshots/test_generate/test_no_input_topic/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_no_input_topic/pipeline.yaml @@ -2,6 +2,7 @@ app: commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -32,6 +33,7 @@ app: commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -77,6 +79,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -103,6 +106,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/snapshots/test_generate/test_no_user_defined_components/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_no_user_defined_components/pipeline.yaml index d8850383e..348443bbc 100644 --- a/tests/pipeline/snapshots/test_generate/test_no_user_defined_components/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_no_user_defined_components/pipeline.yaml @@ -1,6 +1,7 @@ - _cleaner: app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false @@ -26,6 +27,7 @@ version: 2.4.2 app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/snapshots/test_generate/test_pipelines_with_envs/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_pipelines_with_envs/pipeline.yaml index 344e9c5b1..36d50168f 100644 --- a/tests/pipeline/snapshots/test_generate/test_pipelines_with_envs/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_pipelines_with_envs/pipeline.yaml @@ -64,6 +64,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -105,6 +106,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: diff --git a/tests/pipeline/snapshots/test_generate/test_read_from_component/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_read_from_component/pipeline.yaml index 761f21e63..ff1dd9e2b 100644 --- a/tests/pipeline/snapshots/test_generate/test_read_from_component/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_read_from_component/pipeline.yaml @@ -1,5 +1,6 @@ - _cleaner: app: + imageTag: latest streams: brokers: http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092 outputTopic: resources-read-from-component-producer1 @@ -16,6 +17,7 @@ type: producer-app-cleaner version: 2.4.2 app: + imageTag: latest streams: brokers: http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092 outputTopic: resources-read-from-component-producer1 @@ -38,6 +40,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest streams: brokers: http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092 outputTopic: resources-read-from-component-producer2 @@ -54,6 +57,7 @@ type: producer-app-cleaner version: 2.4.2 app: + imageTag: latest streams: brokers: http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092 outputTopic: resources-read-from-component-producer2 @@ -208,6 +212,7 @@ type: kafka-sink-connector - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -232,6 +237,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -400,6 +406,7 @@ type: kafka-sink-connector - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -424,6 +431,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -460,6 +468,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -484,6 +493,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -525,6 +535,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -549,6 +560,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -589,6 +601,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -613,6 +626,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -653,6 +667,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -676,6 +691,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -713,6 +729,7 @@ version: 2.4.2 - _cleaner: app: + imageTag: latest persistence: enabled: false statefulSet: false @@ -736,6 +753,7 @@ type: streams-app-cleaner version: 2.4.2 app: + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/snapshots/test_generate/test_substitute_in_component/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_substitute_in_component/pipeline.yaml index 8ca686f30..8878759fa 100644 --- a/tests/pipeline/snapshots/test_generate/test_substitute_in_component/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_substitute_in_component/pipeline.yaml @@ -72,6 +72,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: @@ -113,6 +114,7 @@ topics: [] commandLine: CONVERT_XML: true + imageTag: latest persistence: enabled: false resources: diff --git a/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_absolute_defaults_path/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_absolute_defaults_path/pipeline.yaml index f78e8f0d1..f96db8745 100644 --- a/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_absolute_defaults_path/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_absolute_defaults_path/pipeline.yaml @@ -1,5 +1,6 @@ - _cleaner: app: + imageTag: latest resources: limits: memory: 2G @@ -21,6 +22,7 @@ type: producer-app-cleaner version: 2.9.0 app: + imageTag: latest resources: limits: memory: 2G @@ -50,6 +52,7 @@ - _cleaner: app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: @@ -77,6 +80,7 @@ version: 2.9.0 app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: diff --git a/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_relative_defaults_path/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_relative_defaults_path/pipeline.yaml index f78e8f0d1..f96db8745 100644 --- a/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_relative_defaults_path/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_with_custom_config_with_relative_defaults_path/pipeline.yaml @@ -1,5 +1,6 @@ - _cleaner: app: + imageTag: latest resources: limits: memory: 2G @@ -21,6 +22,7 @@ type: producer-app-cleaner version: 2.9.0 app: + imageTag: latest resources: limits: memory: 2G @@ -50,6 +52,7 @@ - _cleaner: app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: @@ -77,6 +80,7 @@ version: 2.9.0 app: image: some-image + imageTag: latest labels: pipeline: resources-custom-config persistence: diff --git a/tests/pipeline/snapshots/test_generate/test_with_env_defaults/pipeline.yaml b/tests/pipeline/snapshots/test_generate/test_with_env_defaults/pipeline.yaml index cea0b2660..a37ad0f3d 100644 --- a/tests/pipeline/snapshots/test_generate/test_with_env_defaults/pipeline.yaml +++ b/tests/pipeline/snapshots/test_generate/test_with_env_defaults/pipeline.yaml @@ -1,6 +1,7 @@ - _cleaner: app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false @@ -26,6 +27,7 @@ version: 2.9.0 app: image: fake-image + imageTag: latest persistence: enabled: false statefulSet: false diff --git a/tests/pipeline/test_generate.py b/tests/pipeline/test_generate.py index 915ae17d7..ef68aadf9 100644 --- a/tests/pipeline/test_generate.py +++ b/tests/pipeline/test_generate.py @@ -840,6 +840,10 @@ def test_substitution_in_inflated_component(self): enriched_pipeline[1]["_resetter"]["app"]["label"] == "inflated-connector-name" ) + assert ( + enriched_pipeline[1]["_resetter"]["app"]["imageTag"] + == "override-default-image-tag" + ) def test_substitution_in_resetter(self): pipeline = kpops.generate( @@ -857,3 +861,7 @@ def test_substitution_in_resetter(self): assert enriched_pipeline[0]["name"] == "es-sink-connector" assert enriched_pipeline[0]["_resetter"]["name"] == "es-sink-connector" assert enriched_pipeline[0]["_resetter"]["app"]["label"] == "es-sink-connector" + assert ( + enriched_pipeline[0]["_resetter"]["app"]["imageTag"] + == "override-default-image-tag" + )