diff --git a/api/src/main/java/io/strimzi/api/kafka/model/common/template/AdditionalVolume.java b/api/src/main/java/io/strimzi/api/kafka/model/common/template/AdditionalVolume.java index 08f87cfe1a9..0f41efa9916 100644 --- a/api/src/main/java/io/strimzi/api/kafka/model/common/template/AdditionalVolume.java +++ b/api/src/main/java/io/strimzi/api/kafka/model/common/template/AdditionalVolume.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.fabric8.kubernetes.api.model.CSIVolumeSource; import io.fabric8.kubernetes.api.model.ConfigMapVolumeSource; -import io.fabric8.kubernetes.api.model.EmptyDirVolumeSource; import io.fabric8.kubernetes.api.model.ImageVolumeSource; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSource; import io.fabric8.kubernetes.api.model.SecretVolumeSource; @@ -46,7 +45,7 @@ public class AdditionalVolume implements UnknownPropertyPreserving { private String name; private SecretVolumeSource secret; private ConfigMapVolumeSource configMap; - private EmptyDirVolumeSource emptyDir; + private EmptyDirVolume emptyDir; private PersistentVolumeClaimVolumeSource persistentVolumeClaim; private CSIVolumeSource csi; private ImageVolumeSource image; @@ -85,13 +84,12 @@ public void setConfigMap(ConfigMapVolumeSource configMap) { } @Description("`EmptyDir` to use to populate the volume.") - @KubeLink(group = "core", version = "v1", kind = "emptydirvolumesource") @JsonInclude(JsonInclude.Include.NON_EMPTY) - public EmptyDirVolumeSource getEmptyDir() { + public EmptyDirVolume getEmptyDir() { return emptyDir; } - public void setEmptyDir(EmptyDirVolumeSource emptyDir) { + public void setEmptyDir(EmptyDirVolume emptyDir) { this.emptyDir = emptyDir; } diff --git a/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirMedium.java b/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirMedium.java new file mode 100644 index 00000000000..38200874185 --- /dev/null +++ b/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirMedium.java @@ -0,0 +1,34 @@ +/* + * Copyright Strimzi authors. + * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). + */ +package io.strimzi.api.kafka.model.common.template; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Locale; + +public enum EmptyDirMedium { + MEMORY; + + @JsonCreator + public static EmptyDirMedium forValue(String value) { + switch (value.toLowerCase(Locale.ENGLISH)) { + case "memory": + return MEMORY; + default: + return null; + } + } + + @JsonValue + public String toValue() { + switch (this) { + case MEMORY: + return "Memory"; + default: + return null; + } + } +} diff --git a/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirVolume.java b/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirVolume.java new file mode 100644 index 00000000000..7b1e19a78da --- /dev/null +++ b/api/src/main/java/io/strimzi/api/kafka/model/common/template/EmptyDirVolume.java @@ -0,0 +1,69 @@ +/* + * Copyright Strimzi authors. + * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). + */ +package io.strimzi.api.kafka.model.common.template; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.strimzi.api.kafka.model.common.Constants; +import io.strimzi.api.kafka.model.common.UnknownPropertyPreserving; +import io.strimzi.crdgenerator.annotations.Description; +import io.strimzi.crdgenerator.annotations.Pattern; +import io.sundr.builder.annotations.Buildable; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.HashMap; +import java.util.Map; + +/** + * Representation for EmptyDir volume in additional volumes. This is used because the Fabric8 EmptyDirVolumeSource does + * not serialize nicely into the Strimzi CRDs. + */ +@Buildable( + editableEnabled = false, + builderPackage = Constants.FABRIC8_KUBERNETES_API +) +@JsonInclude(JsonInclude.Include.NON_DEFAULT) +@JsonPropertyOrder({"medium", "sizeLimit"}) +@EqualsAndHashCode +@ToString +public class EmptyDirVolume implements UnknownPropertyPreserving { + private EmptyDirMedium medium; + private String sizeLimit; + private Map additionalProperties; + + @Description("Medium represents the type of storage medium should back this volume. " + + "Valid values are unset or `Memory`.") + public EmptyDirMedium getMedium() { + return medium; + } + + public void setMedium(EmptyDirMedium medium) { + this.medium = medium; + } + + @Pattern(Constants.MEMORY_REGEX) + @Description("The total amount of local storage required for this EmptyDir volume (for example 1Gi).") + public String getSizeLimit() { + return sizeLimit; + } + + public void setSizeLimit(String sizeLimit) { + this.sizeLimit = sizeLimit; + } + + @Override + public Map getAdditionalProperties() { + return this.additionalProperties != null ? this.additionalProperties : Map.of(); + } + + @Override + public void setAdditionalProperty(String name, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(2); + } + this.additionalProperties.put(name, value); + } +} diff --git a/api/src/test/resources/crds/v1/040-Crd-kafka.yaml b/api/src/test/resources/crds/v1/040-Crd-kafka.yaml index c4a448ba2f9..d8c54001920 100644 --- a/api/src/test/resources/crds/v1/040-Crd-kafka.yaml +++ b/api/src/test/resources/crds/v1/040-Crd-kafka.yaml @@ -1171,13 +1171,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2843,13 +2843,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -4091,13 +4091,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -5217,13 +5217,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/api/src/test/resources/crds/v1/041-Crd-kafkaconnect.yaml b/api/src/test/resources/crds/v1/041-Crd-kafkaconnect.yaml index 6011f20c9ac..dcf97b8b89e 100644 --- a/api/src/test/resources/crds/v1/041-Crd-kafkaconnect.yaml +++ b/api/src/test/resources/crds/v1/041-Crd-kafkaconnect.yaml @@ -996,13 +996,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2051,13 +2051,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/api/src/test/resources/crds/v1/045-Crd-kafkanodepool.yaml b/api/src/test/resources/crds/v1/045-Crd-kafkanodepool.yaml index 1d479a6fb64..0c7f7d8812a 100644 --- a/api/src/test/resources/crds/v1/045-Crd-kafkanodepool.yaml +++ b/api/src/test/resources/crds/v1/045-Crd-kafkanodepool.yaml @@ -824,13 +824,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/api/src/test/resources/crds/v1/046-Crd-kafkabridge.yaml b/api/src/test/resources/crds/v1/046-Crd-kafkabridge.yaml index e0e77cd6a70..79483154be4 100644 --- a/api/src/test/resources/crds/v1/046-Crd-kafkabridge.yaml +++ b/api/src/test/resources/crds/v1/046-Crd-kafkabridge.yaml @@ -1021,13 +1021,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/api/src/test/resources/crds/v1/048-Crd-kafkamirrormaker2.yaml b/api/src/test/resources/crds/v1/048-Crd-kafkamirrormaker2.yaml index de6d899fdaf..8b99fd3c13a 100644 --- a/api/src/test/resources/crds/v1/048-Crd-kafkamirrormaker2.yaml +++ b/api/src/test/resources/crds/v1/048-Crd-kafkamirrormaker2.yaml @@ -1246,13 +1246,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2301,13 +2301,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/api/src/test/resources/crds/v1beta2/040-Crd-kafka.yaml b/api/src/test/resources/crds/v1beta2/040-Crd-kafka.yaml index 5769639f057..e69aad69181 100644 --- a/api/src/test/resources/crds/v1beta2/040-Crd-kafka.yaml +++ b/api/src/test/resources/crds/v1beta2/040-Crd-kafka.yaml @@ -1021,13 +1021,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -2496,13 +2494,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -3634,13 +3630,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -4660,13 +4654,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -6290,13 +6282,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -7716,13 +7706,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -8974,13 +8962,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -10326,13 +10312,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -11486,13 +11470,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -12362,13 +12344,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/api/src/test/resources/crds/v1beta2/041-Crd-kafkaconnect.yaml b/api/src/test/resources/crds/v1beta2/041-Crd-kafkaconnect.yaml index 8c5810b84be..d7a78f63326 100644 --- a/api/src/test/resources/crds/v1beta2/041-Crd-kafkaconnect.yaml +++ b/api/src/test/resources/crds/v1beta2/041-Crd-kafkaconnect.yaml @@ -907,13 +907,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -1894,13 +1892,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -3302,13 +3298,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -4289,13 +4283,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/api/src/test/resources/crds/v1beta2/045-Crd-kafkanodepool.yaml b/api/src/test/resources/crds/v1beta2/045-Crd-kafkanodepool.yaml index b75d8165f58..745a054f1d5 100644 --- a/api/src/test/resources/crds/v1beta2/045-Crd-kafkanodepool.yaml +++ b/api/src/test/resources/crds/v1beta2/045-Crd-kafkanodepool.yaml @@ -772,13 +772,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -1958,13 +1956,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/api/src/test/resources/crds/v1beta2/046-Crd-kafkabridge.yaml b/api/src/test/resources/crds/v1beta2/046-Crd-kafkabridge.yaml index 7d132f33a59..67694655249 100644 --- a/api/src/test/resources/crds/v1beta2/046-Crd-kafkabridge.yaml +++ b/api/src/test/resources/crds/v1beta2/046-Crd-kafkabridge.yaml @@ -928,13 +928,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -2368,13 +2366,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/api/src/test/resources/crds/v1beta2/048-Crd-kafkamirrormaker2.yaml b/api/src/test/resources/crds/v1beta2/048-Crd-kafkamirrormaker2.yaml index c5e3aaa8cf0..00ccf38c8e4 100644 --- a/api/src/test/resources/crds/v1beta2/048-Crd-kafkamirrormaker2.yaml +++ b/api/src/test/resources/crds/v1beta2/048-Crd-kafkamirrormaker2.yaml @@ -1105,13 +1105,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -2092,13 +2090,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -3928,13 +3924,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -4915,13 +4909,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/TemplateUtils.java b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/TemplateUtils.java index ebcbd8ef7a1..7a6c5bdc99b 100644 --- a/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/TemplateUtils.java +++ b/cluster-operator/src/main/java/io/strimzi/operator/cluster/model/TemplateUtils.java @@ -4,6 +4,7 @@ */ package io.strimzi.operator.cluster.model; +import io.fabric8.kubernetes.api.model.Quantity; import io.fabric8.kubernetes.api.model.Volume; import io.fabric8.kubernetes.api.model.VolumeBuilder; import io.fabric8.kubernetes.api.model.VolumeMount; @@ -125,7 +126,11 @@ private static Volume createVolumeFromConfig(AdditionalVolume volumeConfig) { } else if (volumeConfig.getSecret() != null) { volumeBuilder.withSecret(volumeConfig.getSecret()); } else if (volumeConfig.getEmptyDir() != null) { - volumeBuilder.withEmptyDir(volumeConfig.getEmptyDir()); + volumeBuilder + .withNewEmptyDir() + .withMedium(volumeConfig.getEmptyDir().getMedium() != null ? volumeConfig.getEmptyDir().getMedium().toValue() : null) + .withSizeLimit(volumeConfig.getEmptyDir().getSizeLimit() != null ? new Quantity(volumeConfig.getEmptyDir().getSizeLimit()) : null) + .endEmptyDir(); } else if (volumeConfig.getPersistentVolumeClaim() != null) { volumeBuilder.withPersistentVolumeClaim(volumeConfig.getPersistentVolumeClaim()); } else if (volumeConfig.getCsi() != null) { diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java index a8c42e58e46..1c994640066 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaConnectClusterTest.java @@ -9,8 +9,6 @@ import io.fabric8.kubernetes.api.model.ConfigMapVolumeSource; import io.fabric8.kubernetes.api.model.ConfigMapVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.Container; -import io.fabric8.kubernetes.api.model.EmptyDirVolumeSource; -import io.fabric8.kubernetes.api.model.EmptyDirVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.EnvVar; import io.fabric8.kubernetes.api.model.EnvVarBuilder; import io.fabric8.kubernetes.api.model.HostAlias; @@ -60,6 +58,9 @@ import io.strimzi.api.kafka.model.common.template.ContainerEnvVar; import io.strimzi.api.kafka.model.common.template.ContainerTemplate; import io.strimzi.api.kafka.model.common.template.DnsPolicy; +import io.strimzi.api.kafka.model.common.template.EmptyDirMedium; +import io.strimzi.api.kafka.model.common.template.EmptyDirVolume; +import io.strimzi.api.kafka.model.common.template.EmptyDirVolumeBuilder; import io.strimzi.api.kafka.model.common.template.IpFamily; import io.strimzi.api.kafka.model.common.template.IpFamilyPolicy; import io.strimzi.api.kafka.model.common.tracing.OpenTelemetryTracing; @@ -917,8 +918,8 @@ public void testTemplate() { .withSecretName("secret1") .build(); - EmptyDirVolumeSource emptyDir = new EmptyDirVolumeSourceBuilder() - .withMedium("Memory") + EmptyDirVolume emptyDir = new EmptyDirVolumeBuilder() + .withMedium(EmptyDirMedium.MEMORY) .build(); AdditionalVolume additionalVolumeConfigMap = new AdditionalVolumeBuilder() diff --git a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/TemplateUtilsTest.java b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/TemplateUtilsTest.java index a1f0c88d307..dc3aa0a8bae 100644 --- a/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/TemplateUtilsTest.java +++ b/cluster-operator/src/test/java/io/strimzi/operator/cluster/model/TemplateUtilsTest.java @@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.CSIVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.ConfigMapVolumeSourceBuilder; -import io.fabric8.kubernetes.api.model.EmptyDirVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.ImageVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimVolumeSourceBuilder; import io.fabric8.kubernetes.api.model.Quantity; @@ -18,6 +17,9 @@ import io.strimzi.api.kafka.model.common.template.AdditionalVolume; import io.strimzi.api.kafka.model.common.template.AdditionalVolumeBuilder; import io.strimzi.api.kafka.model.common.template.ContainerTemplate; +import io.strimzi.api.kafka.model.common.template.EmptyDirMedium; +import io.strimzi.api.kafka.model.common.template.EmptyDirVolume; +import io.strimzi.api.kafka.model.common.template.EmptyDirVolumeBuilder; import io.strimzi.api.kafka.model.common.template.PodTemplate; import io.strimzi.api.kafka.model.common.template.PodTemplateBuilder; import io.strimzi.api.kafka.model.common.template.ResourceTemplate; @@ -118,7 +120,11 @@ public void testAddAdditionalVolumes_ValidInputs() { .build(), new AdditionalVolumeBuilder() .withName("empty-dir-volume") - .withEmptyDir(new EmptyDirVolumeSourceBuilder().withMedium("Memory").withSizeLimit(new Quantity("100Mi")).build()) + .withEmptyDir(new EmptyDirVolumeBuilder().withMedium(EmptyDirMedium.MEMORY).withSizeLimit("100Mi").build()) + .build(), + new AdditionalVolumeBuilder() + .withName("empty-dir-volume-no-options") + .withEmptyDir(new EmptyDirVolume()) .build(), new AdditionalVolumeBuilder() .withName("pvc-volume") @@ -136,7 +142,7 @@ public void testAddAdditionalVolumes_ValidInputs() { TemplateUtils.addAdditionalVolumes(templatePod, existingVolumes); - assertThat(existingVolumes.size(), is(7)); + assertThat(existingVolumes.size(), is(8)); assertThat(existingVolumes.get(0).getName(), is("existingVolume1")); @@ -165,33 +171,42 @@ public void testAddAdditionalVolumes_ValidInputs() { assertThat(existingVolumes.get(3).getCsi(), is(nullValue())); assertThat(existingVolumes.get(3).getImage(), is(nullValue())); - assertThat(existingVolumes.get(4).getName(), is("pvc-volume")); - assertThat(existingVolumes.get(4).getPersistentVolumeClaim().getClaimName(), is("my-pvc")); + assertThat(existingVolumes.get(4).getName(), is("empty-dir-volume-no-options")); + assertThat(existingVolumes.get(4).getEmptyDir().getMedium(), is(nullValue())); + assertThat(existingVolumes.get(4).getEmptyDir().getSizeLimit(), is(nullValue())); assertThat(existingVolumes.get(4).getSecret(), is(nullValue())); assertThat(existingVolumes.get(4).getConfigMap(), is(nullValue())); - assertThat(existingVolumes.get(4).getEmptyDir(), is(nullValue())); + assertThat(existingVolumes.get(4).getPersistentVolumeClaim(), is(nullValue())); assertThat(existingVolumes.get(4).getCsi(), is(nullValue())); assertThat(existingVolumes.get(4).getImage(), is(nullValue())); - assertThat(existingVolumes.get(5).getName(), is("csi-volume")); - assertThat(existingVolumes.get(5).getCsi().getDriver(), is("csi.cert-manager.io")); - assertThat(existingVolumes.get(5).getCsi().getReadOnly(), is(true)); - assertThat(existingVolumes.get(5).getCsi().getVolumeAttributes().get("csi.cert-manager.io/issuer-name"), is("my-ca")); - assertThat(existingVolumes.get(5).getCsi().getVolumeAttributes().get("csi.cert-manager.io/dns-names"), is("${POD_NAME}.${POD_NAMESPACE}.svc.cluster.local")); + assertThat(existingVolumes.get(5).getName(), is("pvc-volume")); + assertThat(existingVolumes.get(5).getPersistentVolumeClaim().getClaimName(), is("my-pvc")); assertThat(existingVolumes.get(5).getSecret(), is(nullValue())); assertThat(existingVolumes.get(5).getConfigMap(), is(nullValue())); assertThat(existingVolumes.get(5).getEmptyDir(), is(nullValue())); - assertThat(existingVolumes.get(5).getPersistentVolumeClaim(), is(nullValue())); + assertThat(existingVolumes.get(5).getCsi(), is(nullValue())); assertThat(existingVolumes.get(5).getImage(), is(nullValue())); - assertThat(existingVolumes.get(6).getName(), is("oci-volume")); - assertThat(existingVolumes.get(6).getImage().getReference(), is("my-custom-oci-plugin:latest")); - assertThat(existingVolumes.get(6).getImage().getPullPolicy(), is("Never")); + assertThat(existingVolumes.get(6).getName(), is("csi-volume")); + assertThat(existingVolumes.get(6).getCsi().getDriver(), is("csi.cert-manager.io")); + assertThat(existingVolumes.get(6).getCsi().getReadOnly(), is(true)); + assertThat(existingVolumes.get(6).getCsi().getVolumeAttributes().get("csi.cert-manager.io/issuer-name"), is("my-ca")); + assertThat(existingVolumes.get(6).getCsi().getVolumeAttributes().get("csi.cert-manager.io/dns-names"), is("${POD_NAME}.${POD_NAMESPACE}.svc.cluster.local")); assertThat(existingVolumes.get(6).getSecret(), is(nullValue())); assertThat(existingVolumes.get(6).getConfigMap(), is(nullValue())); assertThat(existingVolumes.get(6).getEmptyDir(), is(nullValue())); assertThat(existingVolumes.get(6).getPersistentVolumeClaim(), is(nullValue())); - assertThat(existingVolumes.get(6).getCsi(), is(nullValue())); + assertThat(existingVolumes.get(6).getImage(), is(nullValue())); + + assertThat(existingVolumes.get(7).getName(), is("oci-volume")); + assertThat(existingVolumes.get(7).getImage().getReference(), is("my-custom-oci-plugin:latest")); + assertThat(existingVolumes.get(7).getImage().getPullPolicy(), is("Never")); + assertThat(existingVolumes.get(7).getSecret(), is(nullValue())); + assertThat(existingVolumes.get(7).getConfigMap(), is(nullValue())); + assertThat(existingVolumes.get(7).getEmptyDir(), is(nullValue())); + assertThat(existingVolumes.get(7).getPersistentVolumeClaim(), is(nullValue())); + assertThat(existingVolumes.get(7).getCsi(), is(nullValue())); } @Test diff --git a/documentation/modules/appendix_crds.adoc b/documentation/modules/appendix_crds.adoc index e56643c9917..31cff2114c5 100644 --- a/documentation/modules/appendix_crds.adoc +++ b/documentation/modules/appendix_crds.adoc @@ -1329,7 +1329,7 @@ Used in: xref:type-PodTemplate-{context}[`PodTemplate`] |https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#configmapvolumesource-v1-core[ConfigMapVolumeSource] |`ConfigMap` to use to populate the volume. |emptyDir -|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#emptydirvolumesource-v1-core[EmptyDirVolumeSource] +|xref:type-EmptyDirVolume-{context}[`EmptyDirVolume`] |`EmptyDir` to use to populate the volume. |persistentVolumeClaim |https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#persistentvolumeclaimvolumesource-v1-core[PersistentVolumeClaimVolumeSource] @@ -1342,6 +1342,23 @@ Used in: xref:type-PodTemplate-{context}[`PodTemplate`] |`ImageVolumeSource` object to use to populate the volume. |==== +[id='type-EmptyDirVolume-{context}'] += `EmptyDirVolume` schema reference + +Used in: xref:type-AdditionalVolume-{context}[`AdditionalVolume`] + + +[cols="2,2,3a",options="header"] +|==== +|Property |Property type |Description +|medium +|string (one of [Memory]) +|Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. +|sizeLimit +|string +|The total amount of local storage required for this EmptyDir volume (for example 1Gi). +|==== + [id='type-InternalServiceTemplate-{context}'] = `InternalServiceTemplate` schema reference diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/040-Crd-kafka.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/040-Crd-kafka.yaml index 5dfc2280c29..31921332487 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/040-Crd-kafka.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/040-Crd-kafka.yaml @@ -1022,13 +1022,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -2497,13 +2495,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -3635,13 +3631,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -4661,13 +4655,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -6291,13 +6283,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -7717,13 +7707,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -8975,13 +8963,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -10327,13 +10313,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -11487,13 +11471,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -12363,13 +12345,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/041-Crd-kafkaconnect.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/041-Crd-kafkaconnect.yaml index 9bef04fe19e..05aaafffccd 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/041-Crd-kafkaconnect.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/041-Crd-kafkaconnect.yaml @@ -997,13 +997,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2052,13 +2052,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -3668,13 +3668,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -4723,13 +4723,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/045-Crd-kafkanodepool.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/045-Crd-kafkanodepool.yaml index 8a1d957441b..31f14114435 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/045-Crd-kafkanodepool.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/045-Crd-kafkanodepool.yaml @@ -825,13 +825,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2124,13 +2124,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/046-Crd-kafkabridge.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/046-Crd-kafkabridge.yaml index 840aabf0157..7e186bad1e9 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/046-Crd-kafkabridge.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/046-Crd-kafkabridge.yaml @@ -1022,13 +1022,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2648,13 +2648,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/048-Crd-kafkamirrormaker2.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/048-Crd-kafkamirrormaker2.yaml index c63e82513fa..42fae60472e 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/048-Crd-kafkamirrormaker2.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/crds/048-Crd-kafkamirrormaker2.yaml @@ -1247,13 +1247,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2302,13 +2302,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -4477,13 +4477,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -5532,13 +5532,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/install/cluster-operator/040-Crd-kafka.yaml b/packaging/install/cluster-operator/040-Crd-kafka.yaml index 5769639f057..e69aad69181 100644 --- a/packaging/install/cluster-operator/040-Crd-kafka.yaml +++ b/packaging/install/cluster-operator/040-Crd-kafka.yaml @@ -1021,13 +1021,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -2496,13 +2494,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -3634,13 +3630,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -4660,13 +4654,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -6290,13 +6282,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -7716,13 +7706,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -8974,13 +8962,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -10326,13 +10312,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -11486,13 +11470,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: @@ -12362,13 +12344,11 @@ spec: properties: medium: type: string + enum: + - Memory sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" persistentVolumeClaim: type: object properties: diff --git a/packaging/install/cluster-operator/041-Crd-kafkaconnect.yaml b/packaging/install/cluster-operator/041-Crd-kafkaconnect.yaml index f58587ce40f..a624be4fcca 100644 --- a/packaging/install/cluster-operator/041-Crd-kafkaconnect.yaml +++ b/packaging/install/cluster-operator/041-Crd-kafkaconnect.yaml @@ -996,13 +996,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2051,13 +2051,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -3667,13 +3667,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -4722,13 +4722,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/install/cluster-operator/045-Crd-kafkanodepool.yaml b/packaging/install/cluster-operator/045-Crd-kafkanodepool.yaml index 3ed9f28dfea..83d9ca2b803 100644 --- a/packaging/install/cluster-operator/045-Crd-kafkanodepool.yaml +++ b/packaging/install/cluster-operator/045-Crd-kafkanodepool.yaml @@ -824,13 +824,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2123,13 +2123,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/install/cluster-operator/046-Crd-kafkabridge.yaml b/packaging/install/cluster-operator/046-Crd-kafkabridge.yaml index 3d893b6b218..25d37db2092 100644 --- a/packaging/install/cluster-operator/046-Crd-kafkabridge.yaml +++ b/packaging/install/cluster-operator/046-Crd-kafkabridge.yaml @@ -1021,13 +1021,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2647,13 +2647,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object diff --git a/packaging/install/cluster-operator/048-Crd-kafkamirrormaker2.yaml b/packaging/install/cluster-operator/048-Crd-kafkamirrormaker2.yaml index 30ab116b5cd..08d2f57cbd8 100644 --- a/packaging/install/cluster-operator/048-Crd-kafkamirrormaker2.yaml +++ b/packaging/install/cluster-operator/048-Crd-kafkamirrormaker2.yaml @@ -1246,13 +1246,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -2301,13 +2301,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -4476,13 +4476,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object @@ -5531,13 +5531,13 @@ spec: properties: medium: type: string + enum: + - Memory + description: Medium represents the type of storage medium should back this volume. Valid values are unset or `Memory`. sizeLimit: - type: object - properties: - amount: - type: string - format: - type: string + type: string + pattern: "^([0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + description: The total amount of local storage required for this EmptyDir volume (for example 1Gi). description: '`EmptyDir` to use to populate the volume.' persistentVolumeClaim: type: object