Skip to content

Commit faea6aa

Browse files
nmarukovichhors
andauthored
K8SPSMDB-995 add sse to secret (#1510)
* K8SPSMDB-995 add sse to secret --------- Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent fac36e5 commit faea6aa

File tree

13 files changed

+114
-37
lines changed

13 files changed

+114
-37
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7640,6 +7640,8 @@ spec:
76407640
type: string
76417641
ldapSecret:
76427642
type: string
7643+
sse:
7644+
type: string
76437645
ssl:
76447646
type: string
76457647
sslInternal:

deploy/bundle.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8287,6 +8287,8 @@ spec:
82878287
type: string
82888288
ldapSecret:
82898289
type: string
8290+
sse:
8291+
type: string
82908292
ssl:
82918293
type: string
82928294
sslInternal:

deploy/cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ spec:
4444
encryptionKey: my-cluster-name-mongodb-encryption-key
4545
# vault: my-cluster-name-vault
4646
# ldapSecret: my-ldap-secret
47+
# sse: my-cluster-name-sse
4748
pmm:
4849
enabled: false
4950
image: perconalab/pmm-client:dev-latest

deploy/crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8287,6 +8287,8 @@ spec:
82878287
type: string
82888288
ldapSecret:
82898289
type: string
8290+
sse:
8291+
type: string
82908292
ssl:
82918293
type: string
82928294
sslInternal:

deploy/cw-bundle.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8287,6 +8287,8 @@ spec:
82878287
type: string
82888288
ldapSecret:
82898289
type: string
8290+
sse:
8291+
type: string
82908292
ssl:
82918293
type: string
82928294
sslInternal:

deploy/sse-secret.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: my-cluster-name-sse
5+
type: Opaque
6+
stringData:
7+
KMS_KEY_ID: "3338fac1-4f-lklklj-kjhjk"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8287,6 +8287,8 @@ spec:
82878287
type: string
82888288
ldapSecret:
82898289
type: string
8290+
sse:
8291+
type: string
82908292
ssl:
82918293
type: string
82928294
sslInternal:

pkg/apis/psmdb/v1/psmdb_defaults.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,6 @@ func (cr *PerconaServerMongoDB) CheckNSetDefaults(platform version.Platform, log
493493
}
494494

495495
if len(stg.S3.ServerSideEncryption.SSECustomerAlgorithm) != 0 &&
496-
len(stg.S3.ServerSideEncryption.SSECustomerKey) != 0 &&
497-
len(stg.S3.ServerSideEncryption.KMSKeyID) != 0 &&
498496
len(stg.S3.ServerSideEncryption.SSEAlgorithm) != 0 {
499497
return errors.New("For S3 storage only one encryption method can be used. Set either (sseAlgorithm and kmsKeyID) or (sseCustomerAlgorithm and sseCustomerKey)")
500498
}

pkg/apis/psmdb/v1/psmdb_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ type SecretsSpec struct {
625625
SSLInternal string `json:"sslInternal,omitempty"`
626626
EncryptionKey string `json:"encryptionKey,omitempty"`
627627
Vault string `json:"vault,omitempty"`
628+
SSE string `json:"sse,omitempty"`
628629
LDAPSecret string `json:"ldapSecret,omitempty"`
629630
}
630631

pkg/controller/perconaservermongodb/psmdb_controller.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,19 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
137137

138138
type CronRegistry struct {
139139
crons *cron.Cron
140-
jobs map[string]Shedule
140+
jobs map[string]Schedule
141141
backupJobs *sync.Map
142142
}
143143

144-
type Shedule struct {
145-
ID int
146-
CronShedule string
144+
type Schedule struct {
145+
ID int
146+
CronSchedule string
147147
}
148148

149149
func NewCronRegistry() CronRegistry {
150150
c := CronRegistry{
151151
crons: cron.New(),
152-
jobs: make(map[string]Shedule),
152+
jobs: make(map[string]Schedule),
153153
backupJobs: new(sync.Map),
154154
}
155155

@@ -293,7 +293,6 @@ func (r *ReconcilePerconaServerMongoDB) Reconcile(ctx context.Context, request r
293293
if err != nil {
294294
return reconcile.Result{}, errors.Wrap(err, "reconcile users secret")
295295
}
296-
297296
repls := cr.Spec.Replsets
298297
if cr.Spec.Sharding.Enabled && cr.Spec.Sharding.ConfigsvrReplSet != nil {
299298
repls = append([]*api.ReplsetSpec{cr.Spec.Sharding.ConfigsvrReplSet}, repls...)

0 commit comments

Comments
 (0)