Skip to content

Commit 18fea0b

Browse files
committed
Comments from Paolo and Jakub
Signed-off-by: Lukas Kral <lukywill16@gmail.com>
1 parent b0974cc commit 18fea0b

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConnectBuild.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
public class KafkaConnectBuild extends AbstractModel {
5252
protected static final String COMPONENT_TYPE = "kafka-connect-build";
5353

54-
private static final String DEFAULT_KANIKO_EXECUTOR_IMAGE = "gcr.io/kaniko-project/executor:latest";
55-
private static final String DEFAULT_BUILDAH_IMAGE = "quay.io/strimzi/buildah:latest";
54+
/*test*/ static final String DEFAULT_KANIKO_EXECUTOR_IMAGE = "gcr.io/kaniko-project/executor:latest";
55+
/*test*/ static final String DEFAULT_BUILDAH_IMAGE = "quay.io/strimzi/buildah:latest";
5656

5757
protected static final String CO_ENV_VAR_CUSTOM_CONNECT_BUILD_POD_LABELS = "STRIMZI_CUSTOM_KAFKA_CONNECT_BUILD_LABELS";
5858

@@ -84,6 +84,7 @@ public class KafkaConnectBuild extends AbstractModel {
8484
protected KafkaConnectBuild(Reconciliation reconciliation, HasMetadata resource, SharedEnvironmentProvider sharedEnvironmentProvider, boolean useConnectBuildWithBuildah) {
8585
super(reconciliation, resource, KafkaConnectResources.buildPodName(resource.getMetadata().getName()), COMPONENT_TYPE, sharedEnvironmentProvider);
8686

87+
// TODO: use configuration from the `ClusterOperatorConfig` rather than from env variables directly - https://github.com/strimzi/strimzi-kafka-operator/issues/11981
8788
if (useConnectBuildWithBuildah) {
8889
this.image = System.getenv().getOrDefault(ClusterOperatorConfig.STRIMZI_DEFAULT_BUILDAH_IMAGE, DEFAULT_BUILDAH_IMAGE);
8990
} else {

cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectBuildTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ public void testKanikoDeployment() {
212212
assertThat(pod.getSpec().getContainers().size(), is(1));
213213
assertThat(pod.getSpec().getContainers().get(0).getArgs(), is(defaultKanikoArgs));
214214
assertThat(pod.getSpec().getContainers().get(0).getName(), is(KafkaConnectResources.buildPodName(this.cluster)));
215-
assertThat(pod.getSpec().getContainers().get(0).getImage(), is(build.image));
215+
// TODO: use configuration from the `ClusterOperatorConfig` rather than from env variables directly - https://github.com/strimzi/strimzi-kafka-operator/issues/11981
216+
assertThat(pod.getSpec().getContainers().get(0).getImage(), is(KafkaConnectBuild.DEFAULT_KANIKO_EXECUTOR_IMAGE));
216217
assertThat(pod.getSpec().getContainers().get(0).getPorts(), is(nullValue()));
217218
assertThat(pod.getSpec().getContainers().get(0).getResources().getLimits(), is(limit));
218219
assertThat(pod.getSpec().getContainers().get(0).getResources().getRequests(), is(request));
@@ -283,7 +284,8 @@ public void testBuildahDeployment() {
283284
assertThat(commands[0], containsString(defaultBuildahBuildArgs));
284285
assertThat(commands[1], containsString(defaultBuildahPushArgs));
285286
assertThat(pod.getSpec().getContainers().get(0).getName(), is(KafkaConnectResources.buildPodName(this.cluster)));
286-
assertThat(pod.getSpec().getContainers().get(0).getImage(), is(build.image));
287+
// TODO: use configuration from the `ClusterOperatorConfig` rather than from env variables directly - https://github.com/strimzi/strimzi-kafka-operator/issues/11981
288+
assertThat(pod.getSpec().getContainers().get(0).getImage(), is(KafkaConnectBuild.DEFAULT_BUILDAH_IMAGE));
287289
assertThat(pod.getSpec().getContainers().get(0).getPorts(), is(nullValue()));
288290
assertThat(pod.getSpec().getContainers().get(0).getResources().getLimits(), is(limit));
289291
assertThat(pod.getSpec().getContainers().get(0).getResources().getRequests(), is(request));

documentation/modules/appendix_crds.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,10 +3106,10 @@ It must have the value `docker` for the type `DockerOutput`.
31063106
|**The `additionalKanikoOptions` property has been deprecated, and should now be configured using `.spec.build.output.additionalBuildOptions`.** The `additionalKanikoOptions` configuration is deprecated and will be removed in the `v1` CRD API. Configures additional options which will be passed to the Kaniko executor when building the new Connect image. Allowed options are: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. These options will be used only on Kubernetes where the Kaniko executor is used. They will be ignored on OpenShift. The options are described in the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^]. Changing this field does not trigger new build of the Kafka Connect image.
31073107
|additionalBuildOptions
31083108
|string array
3109-
|Configures additional options which will be passed either to Kaniko or Buildah `build` command (depending on feature gate) when building the new Connect image. Allowed Kaniko options are: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options are: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Kaniko and Buildah are used. They will be ignored on OpenShift. The Kaniko options are described in the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^]. The Buildah options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger new build of the Kafka Connect image.
3109+
|Configures additional options to pass to the `build` command of either Kaniko or Buildah (depending on the feature gate setting) when building a new Kafka Connect image. Allowed Kaniko options: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Kaniko and Buildah are available. They are ignored on OpenShift. For more information, see the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^] or the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger a rebuild of the Kafka Connect image.
31103110
|additionalPushOptions
31113111
|string array
3112-
|Configures additional options which will be passed to the Buildah `push` when pushing the new Connect image. Allowed options are: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Buildah is used. They will be ignored on OpenShift. The options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger new build of the Kafka Connect image.
3112+
|Configures additional options to pass to the Buildah `push` command when pushing a new Connect image. Allowed options: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Buildah is available. They are ignored on OpenShift. For more information, see the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger a rebuild of the Kafka Connect image.
31133113
|type
31143114
|string
31153115
|Must be `docker`.

packaging/helm-charts/helm3/strimzi-kafka-operator/crds/041-Crd-kafkaconnect.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,7 +2588,7 @@ spec:
25882588
type: array
25892589
items:
25902590
type: string
2591-
description: "Configures additional options which will be passed either to Kaniko or Buildah `build` command (depending on feature gate) when building the new Connect image. Allowed Kaniko options are: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options are: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Kaniko and Buildah are used. They will be ignored on OpenShift. The Kaniko options are described in the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^]. The Buildah options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger new build of the Kafka Connect image."
2591+
description: "Configures additional options to pass to the `build` command of either Kaniko or Buildah (depending on the feature gate setting) when building a new Kafka Connect image. Allowed Kaniko options: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Kaniko and Buildah are available. They are ignored on OpenShift. For more information, see the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^] or the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger a rebuild of the Kafka Connect image."
25922592
additionalKanikoOptions:
25932593
type: array
25942594
items:
@@ -2598,7 +2598,7 @@ spec:
25982598
type: array
25992599
items:
26002600
type: string
2601-
description: "Configures additional options which will be passed to the Buildah `push` when pushing the new Connect image. Allowed options are: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Buildah is used. They will be ignored on OpenShift. The options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger new build of the Kafka Connect image."
2601+
description: "Configures additional options to pass to the Buildah `push` command when pushing a new Connect image. Allowed options: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Buildah is available. They are ignored on OpenShift. For more information, see the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger a rebuild of the Kafka Connect image."
26022602
image:
26032603
type: string
26042604
description: The name of the image which will be built. Required.

packaging/install/cluster-operator/041-Crd-kafkaconnect.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,7 +2587,7 @@ spec:
25872587
type: array
25882588
items:
25892589
type: string
2590-
description: "Configures additional options which will be passed either to Kaniko or Buildah `build` command (depending on feature gate) when building the new Connect image. Allowed Kaniko options are: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options are: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Kaniko and Buildah are used. They will be ignored on OpenShift. The Kaniko options are described in the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^]. The Buildah options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger new build of the Kafka Connect image."
2590+
description: "Configures additional options to pass to the `build` command of either Kaniko or Buildah (depending on the feature gate setting) when building a new Kafka Connect image. Allowed Kaniko options: --customPlatform, --custom-platform, --insecure, --insecure-pull, --insecure-registry, --log-format, --log-timestamp, --registry-mirror, --reproducible, --single-snapshot, --skip-tls-verify, --skip-tls-verify-pull, --skip-tls-verify-registry, --verbosity, --snapshotMode, --use-new-run, --registry-certificate, --registry-client-cert, --ignore-path. Allowed Buildah `build` options: --authfile, --cert-dir, --creds, --decryption-key, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Kaniko and Buildah are available. They are ignored on OpenShift. For more information, see the link:https://github.com/GoogleContainerTools/kaniko[Kaniko GitHub repository^] or the link:https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md[Buildah build document^]. Changing this field does not trigger a rebuild of the Kafka Connect image."
25912591
additionalKanikoOptions:
25922592
type: array
25932593
items:
@@ -2597,7 +2597,7 @@ spec:
25972597
type: array
25982598
items:
25992599
type: string
2600-
description: "Configures additional options which will be passed to the Buildah `push` when pushing the new Connect image. Allowed options are: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those will be used only on Kubernetes, where Buildah is used. They will be ignored on OpenShift. The options are described in the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger new build of the Kafka Connect image."
2600+
description: "Configures additional options to pass to the Buildah `push` command when pushing a new Connect image. Allowed options: --authfile, --cert-dir, --creds, --quiet, --retry, --retry-delay, --tls-verify. Those options are used only on Kubernetes, where Buildah is available. They are ignored on OpenShift. For more information, see the link:https://github.com/containers/buildah/blob/main/docs/buildah-push.1.md[Buildah push document^]. Changing this field does not trigger a rebuild of the Kafka Connect image."
26012601
image:
26022602
type: string
26032603
description: The name of the image which will be built. Required.

0 commit comments

Comments
 (0)