Skip to content

Commit

Permalink
Merge pull request #1864 from deepsm007/add-chunksize-var
Browse files Browse the repository at this point in the history
Expose chunksize variable for S3 storage driver
  • Loading branch information
openshift-merge-bot[bot] authored and gcs278 committed May 6, 2024
2 parents 56da039 + 62065c7 commit d4cada8
Show file tree
Hide file tree
Showing 29 changed files with 19,152 additions and 3 deletions.
2 changes: 2 additions & 0 deletions features.md
Expand Up @@ -13,6 +13,7 @@
| MachineAPIOperatorDisableMachineHealthCheckController| | | | | | |
| AutomatedEtcdBackup| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| CSIDriverSharedResource| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| ChunkSizeMiB| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| DNSNameResolver| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| DynamicResourceAllocation| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| EtcdBackendQuota| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand All @@ -23,6 +24,7 @@
| GatewayAPI| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| HardwareSpeed| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| ImagePolicy| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| IngressControllerLBSubnetsAWS| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| InsightsConfig| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| InsightsConfigAPI| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| InsightsOnDemandDataGather| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
14 changes: 14 additions & 0 deletions features/features.go
Expand Up @@ -515,4 +515,18 @@ var (
contactPerson("rvanderp3").
productScope(ocpSpecific).
mustRegister()

FeatureGateChunkSizeMiB = newFeatureGate("ChunkSizeMiB").
reportProblemsToJiraComponent("Image Registry").
contactPerson("flavianmissi").
productScope(ocpSpecific).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateIngressControllerLBSubnetsAWS = newFeatureGate("IngressControllerLBSubnetsAWS").
reportProblemsToJiraComponent("Routing").
contactPerson("gspence").
productScope(ocpSpecific).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
)
@@ -0,0 +1,99 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Config"
crdName: configs.imageregistry.operator.openshift.io
featureGate: ChunkSizeMiB
tests:
onCreate:
- name: Should be able to create a minimal Config
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
expected: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
logLevel: Normal
operatorLogLevel: Normal
replicas: 1
- name: Should be able to configure chunksizemib for storage s3
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
storage:
s3:
bucket: bucket-1
region: region-1
chunkSizeMiB: 10
expected: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
logLevel: Normal
operatorLogLevel: Normal
replicas: 1
storage:
s3:
bucket: bucket-1
region: region-1
chunkSizeMiB: 10
- name: Should be able to configure storage s3 without chunkSizeMiB
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
storage:
s3:
bucket: bucket-2
region: region-2
expected: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
logLevel: Normal
operatorLogLevel: Normal
replicas: 1
storage:
s3:
bucket: bucket-2
region: region-2
- name: Should reject configuration with value less than 5 in chunkSizeMiB for storage s3
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
storage:
s3:
bucket: bucket-2
region: region-2
chunkSizeMiB: 2
expectedError: "Invalid value: 2: spec.storage.s3.chunkSizeMiB in body should be greater than or equal to 5"
- name: Should reject configuration with value more than 5120 in chunkSizeMiB for storage s3
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
storage:
s3:
bucket: bucket-3
region: region-3
chunkSizeMiB: 6000
expectedError: "Invalid value: 6000: spec.storage.s3.chunkSizeMiB in body should be less than or equal to 5120"
- name: Should reject configuration with decimal value in chunkSizeMiB for storage s3
initial: |
apiVersion: imageregistry.operator.openshift.io/v1
kind: Config
spec:
replicas: 1
storage:
s3:
bucket: bucket-4
region: region-4
chunkSizeMiB: 19.5
expectedError: "Invalid value: \"number\": spec.storage.s3.chunkSizeMiB in body must be of type integer: \"number\""
11 changes: 11 additions & 0 deletions imageregistry/v1/types.go
Expand Up @@ -207,6 +207,17 @@ type ImageRegistryConfigStorageS3 struct {
// Optional, defaults based on the Region that is provided.
// +optional
RegionEndpoint string `json:"regionEndpoint,omitempty"`
// chunkSizeMiB defines the size of the multipart upload chunks of the S3 API.
// The S3 API requires multipart upload chunks to be at least 5MiB.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
// The current default value is 10 MiB.
// The value is an integer number of MiB.
// The minimum value is 5 and the maximum value is 5120 (5 GiB).
// +kubebuilder:validation:Minimum=5
// +kubebuilder:validation:Maximum=5120
// +openshift:enable:FeatureGate=ChunkSizeMiB
// +optional
ChunkSizeMiB int32 `json:"chunkSizeMiB,omitempty"`
// encrypt specifies whether the registry stores the image in encrypted
// format or not.
// Optional, defaults to false.
Expand Down

0 comments on commit d4cada8

Please sign in to comment.