Skip to content

Commit 6dc0f95

Browse files
remove required kubebuilder tags
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
1 parent 6a39abb commit 6dc0f95

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbbackups.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ spec:
179179
type: boolean
180180
required:
181181
- bucket
182-
- endpointUrl
183182
type: object
184183
pbmName:
185184
type: string

config/crd/bases/psmdb.percona.com_perconaservermongodbrestores.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ spec:
142142
type: boolean
143143
required:
144144
- bucket
145-
- endpointUrl
146145
type: object
147146
pbmName:
148147
type: string

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ spec:
387387
type: boolean
388388
required:
389389
- bucket
390-
- endpointUrl
391390
type: object
392391
s3:
393392
properties:

deploy/bundle.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ spec:
183183
type: boolean
184184
required:
185185
- bucket
186-
- endpointUrl
187186
type: object
188187
pbmName:
189188
type: string
@@ -411,7 +410,6 @@ spec:
411410
type: boolean
412411
required:
413412
- bucket
414-
- endpointUrl
415413
type: object
416414
pbmName:
417415
type: string
@@ -1250,7 +1248,6 @@ spec:
12501248
type: boolean
12511249
required:
12521250
- bucket
1253-
- endpointUrl
12541251
type: object
12551252
s3:
12561253
properties:

deploy/crd.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ spec:
183183
type: boolean
184184
required:
185185
- bucket
186-
- endpointUrl
187186
type: object
188187
pbmName:
189188
type: string
@@ -411,7 +410,6 @@ spec:
411410
type: boolean
412411
required:
413412
- bucket
414-
- endpointUrl
415413
type: object
416414
pbmName:
417415
type: string
@@ -1250,7 +1248,6 @@ spec:
12501248
type: boolean
12511249
required:
12521250
- bucket
1253-
- endpointUrl
12541251
type: object
12551252
s3:
12561253
properties:

deploy/cw-bundle.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ spec:
183183
type: boolean
184184
required:
185185
- bucket
186-
- endpointUrl
187186
type: object
188187
pbmName:
189188
type: string
@@ -411,7 +410,6 @@ spec:
411410
type: boolean
412411
required:
413412
- bucket
414-
- endpointUrl
415413
type: object
416414
pbmName:
417415
type: string
@@ -1250,7 +1248,6 @@ spec:
12501248
type: boolean
12511249
required:
12521250
- bucket
1253-
- endpointUrl
12541251
type: object
12551252
s3:
12561253
properties:

e2e-tests/version-service/conf/crd.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ spec:
183183
type: boolean
184184
required:
185185
- bucket
186-
- endpointUrl
187186
type: object
188187
pbmName:
189188
type: string
@@ -411,7 +410,6 @@ spec:
411410
type: boolean
412411
required:
413412
- bucket
414-
- endpointUrl
415413
type: object
416414
pbmName:
417415
type: string
@@ -1250,7 +1248,6 @@ spec:
12501248
type: boolean
12511249
required:
12521250
- bucket
1253-
- endpointUrl
12541251
type: object
12551252
s3:
12561253
properties:

pkg/apis/psmdb/v1/psmdb_types.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,19 +1031,30 @@ type BackupStorageS3Spec struct {
10311031
}
10321032

10331033
type BackupStorageMinioSpec struct {
1034-
//+kubebuilder:validation:Required
1035-
EndpointURL string `json:"endpointUrl,omitempty"`
1036-
//+kubebuilder:validation:Required
10371034
Bucket string `json:"bucket"`
1038-
Region string `json:"region,omitempty"`
10391035
Prefix string `json:"prefix,omitempty"`
1040-
Secure bool `json:"secure,omitempty"`
1036+
Region string `json:"region,omitempty"`
1037+
EndpointURL string `json:"endpointUrl,omitempty"`
10411038
CredentialsSecret string `json:"credentialsSecret,omitempty"`
1039+
PartSize int64 `json:"partSize,omitempty"`
10421040
InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
10431041
ForcePathStyle *bool `json:"forcePathStyle,omitempty"`
10441042
DebugTrace bool `json:"debugTrace,omitempty"`
1045-
PartSize int64 `json:"partSize,omitempty"`
10461043
Retryer *MinioRetryer `json:"retryer,omitempty"`
1044+
Secure bool `json:"secure,omitempty"`
1045+
}
1046+
1047+
func (spec BackupStorageMinioSpec) Validate() error {
1048+
if spec.EndpointURL == "" {
1049+
return errors.New("endpointURL is required")
1050+
}
1051+
if spec.Bucket == "" {
1052+
return errors.New("bucket is required")
1053+
}
1054+
if spec.CredentialsSecret == "" {
1055+
return errors.New("credentialsSecret is required")
1056+
}
1057+
return nil
10471058
}
10481059

10491060
type MinioRetryer struct {

pkg/psmdb/backup/pbm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ func GetPBMStorageMinioConfig(
341341
cluster *api.PerconaServerMongoDB,
342342
stg api.BackupStorageSpec,
343343
) (config.StorageConf, error) {
344+
if err := stg.Minio.Validate(); err != nil {
345+
return config.StorageConf{}, errors.Wrap(err, "invalid minio storage config")
346+
}
347+
344348
storageConf := config.StorageConf{
345349
Type: storage.Minio,
346350
Minio: &mio.Config{

0 commit comments

Comments
 (0)