From b3ee2254333d05ef0ca0623276e1eda5f37537ef Mon Sep 17 00:00:00 2001 From: Viacheslav Sarzhan Date: Fri, 19 May 2023 11:43:59 +0300 Subject: [PATCH 1/2] K8SPXC-1195 add bucket and container options as required --- ....percona.com_perconaxtradbclusterbackups.yaml | 4 ++++ ...percona.com_perconaxtradbclusterrestores.yaml | 8 ++++++++ .../pxc.percona.com_perconaxtradbclusters.yaml | 4 ++++ deploy/bundle.yaml | 16 ++++++++++++++++ deploy/crd.yaml | 16 ++++++++++++++++ deploy/cw-bundle.yaml | 16 ++++++++++++++++ pkg/apis/pxc/v1/pxc_types.go | 2 ++ 7 files changed, 66 insertions(+) diff --git a/config/crd/bases/pxc.percona.com_perconaxtradbclusterbackups.yaml b/config/crd/bases/pxc.percona.com_perconaxtradbclusterbackups.yaml index 68ef8fef7f..1048a21d10 100644 --- a/config/crd/bases/pxc.percona.com_perconaxtradbclusterbackups.yaml +++ b/config/crd/bases/pxc.percona.com_perconaxtradbclusterbackups.yaml @@ -75,6 +75,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -132,6 +134,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string diff --git a/config/crd/bases/pxc.percona.com_perconaxtradbclusterrestores.yaml b/config/crd/bases/pxc.percona.com_perconaxtradbclusterrestores.yaml index 9e5da3fcf3..83376b0ed5 100644 --- a/config/crd/bases/pxc.percona.com_perconaxtradbclusterrestores.yaml +++ b/config/crd/bases/pxc.percona.com_perconaxtradbclusterrestores.yaml @@ -60,6 +60,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -117,6 +119,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -147,6 +151,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -204,6 +210,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string diff --git a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml index 34bfd6a089..d10aadfffa 100644 --- a/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml +++ b/config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml @@ -500,6 +500,8 @@ spec: type: string storageClass: type: string + required: + - container type: object containerSecurityContext: properties: @@ -679,6 +681,8 @@ spec: type: string region: type: string + required: + - bucket type: object schedulerName: type: string diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index c356ae81e8..c394d0bc97 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -74,6 +74,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -131,6 +133,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -220,6 +224,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -277,6 +283,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -307,6 +315,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -364,6 +374,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -1206,6 +1218,8 @@ spec: type: string storageClass: type: string + required: + - container type: object containerSecurityContext: properties: @@ -1385,6 +1399,8 @@ spec: type: string region: type: string + required: + - bucket type: object schedulerName: type: string diff --git a/deploy/crd.yaml b/deploy/crd.yaml index 4d73e14c78..422b625de9 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -74,6 +74,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -131,6 +133,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -220,6 +224,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -277,6 +283,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -307,6 +315,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -364,6 +374,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -1206,6 +1218,8 @@ spec: type: string storageClass: type: string + required: + - container type: object containerSecurityContext: properties: @@ -1385,6 +1399,8 @@ spec: type: string region: type: string + required: + - bucket type: object schedulerName: type: string diff --git a/deploy/cw-bundle.yaml b/deploy/cw-bundle.yaml index 58fb62e200..563df115a6 100644 --- a/deploy/cw-bundle.yaml +++ b/deploy/cw-bundle.yaml @@ -74,6 +74,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -131,6 +133,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -220,6 +224,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -277,6 +283,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -307,6 +315,8 @@ spec: type: string storageClass: type: string + required: + - container type: object completed: format: date-time @@ -364,6 +374,8 @@ spec: type: string region: type: string + required: + - bucket type: object sslInternalSecretName: type: string @@ -1206,6 +1218,8 @@ spec: type: string storageClass: type: string + required: + - container type: object containerSecurityContext: properties: @@ -1385,6 +1399,8 @@ spec: type: string region: type: string + required: + - bucket type: object schedulerName: type: string diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index b121e50e17..459dbbe2d7 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -522,6 +522,7 @@ const ( ) type BackupStorageS3Spec struct { + // +kubebuilder:validation:Required Bucket string `json:"bucket"` CredentialsSecret string `json:"credentialsSecret"` Region string `json:"region,omitempty"` @@ -530,6 +531,7 @@ type BackupStorageS3Spec struct { type BackupStorageAzureSpec struct { CredentialsSecret string `json:"credentialsSecret"` + // +kubebuilder:validation:Required ContainerPath string `json:"container"` Endpoint string `json:"endpointUrl"` StorageClass string `json:"storageClass"` From c9fb53b6e3befbf35efb8339101e34a651e6c209 Mon Sep 17 00:00:00 2001 From: Viacheslav Sarzhan Date: Fri, 19 May 2023 14:48:28 +0300 Subject: [PATCH 2/2] Update pkg/apis/pxc/v1/pxc_types.go Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- pkg/apis/pxc/v1/pxc_types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/pxc/v1/pxc_types.go b/pkg/apis/pxc/v1/pxc_types.go index 459dbbe2d7..36c79f0c9d 100644 --- a/pkg/apis/pxc/v1/pxc_types.go +++ b/pkg/apis/pxc/v1/pxc_types.go @@ -532,9 +532,9 @@ type BackupStorageS3Spec struct { type BackupStorageAzureSpec struct { CredentialsSecret string `json:"credentialsSecret"` // +kubebuilder:validation:Required - ContainerPath string `json:"container"` - Endpoint string `json:"endpointUrl"` - StorageClass string `json:"storageClass"` + ContainerPath string `json:"container"` + Endpoint string `json:"endpointUrl"` + StorageClass string `json:"storageClass"` } const (