Skip to content

Commit e0387f4

Browse files
authored
Remove datastreams iam sa key (#242)
1 parent e600025 commit e0387f4

File tree

5 files changed

+3
-38
lines changed

5 files changed

+3
-38
lines changed

api/v1alpha1/const.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ const (
3434
DatabaseEncryptionKeySecretFile = "key.pem"
3535
DatabaseEncryptionKeyConfigFile = "key.txt"
3636

37-
DatastreamsIAMServiceAccountKeyDir = "datastreams"
38-
DatastreamsIAMServiceAccountKeyFile = "sa_key.json"
39-
4037
BinariesDir = "/opt/ydb/bin"
4138
DaemonBinaryName = "ydbd"
4239

api/v1alpha1/database_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,6 @@ type EncryptionConfig struct {
249249
type DatastreamsConfig struct {
250250
// +required
251251
Enabled bool `json:"enabled"`
252-
253-
// +required
254-
IAMServiceAccountKey *corev1.SecretKeySelector `json:"iam_service_account_key,omitempty"`
255252
}
256253

257254
type DatabaseServices struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/resources/database_statefulset.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ func (b *DatabaseStatefulSetBuilder) buildVolumes() []corev1.Volume {
183183
}
184184

185185
if b.Spec.Datastreams != nil && b.Spec.Datastreams.Enabled {
186-
volumes = append(volumes, b.buildDatastreamsIAMServiceAccountKeyVolume())
187186
if b.Spec.Service.Datastreams.TLSConfiguration.Enabled {
188187
volumes = append(volumes, buildTLSVolume(datastreamsTLSVolumeName, b.Spec.Service.Datastreams.TLSConfiguration))
189188
}
@@ -385,23 +384,6 @@ func (b *DatabaseStatefulSetBuilder) buildEncryptionVolumes() []corev1.Volume {
385384
return []corev1.Volume{encryptionKeySecret, encryptionKeyConfig}
386385
}
387386

388-
func (b *DatabaseStatefulSetBuilder) buildDatastreamsIAMServiceAccountKeyVolume() corev1.Volume {
389-
return corev1.Volume{
390-
Name: datastreamsIAMServiceAccountKeyVolumeName,
391-
VolumeSource: corev1.VolumeSource{
392-
Secret: &corev1.SecretVolumeSource{
393-
SecretName: b.Spec.Datastreams.IAMServiceAccountKey.Name,
394-
Items: []corev1.KeyToPath{
395-
{
396-
Key: b.Spec.Datastreams.IAMServiceAccountKey.Key,
397-
Path: api.DatastreamsIAMServiceAccountKeyFile,
398-
},
399-
},
400-
},
401-
},
402-
}
403-
}
404-
405387
func (b *DatabaseStatefulSetBuilder) buildContainer() corev1.Container {
406388
command, args := b.buildContainerArgs()
407389
imagePullPolicy := corev1.PullIfNotPresent
@@ -509,11 +491,6 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount {
509491
}
510492

511493
if b.Spec.Datastreams != nil && b.Spec.Datastreams.Enabled {
512-
volumeMounts = append(volumeMounts, corev1.VolumeMount{
513-
Name: datastreamsIAMServiceAccountKeyVolumeName,
514-
ReadOnly: true,
515-
MountPath: api.DatastreamsIAMServiceAccountKeyDir,
516-
})
517494
if b.Spec.Service.Datastreams.TLSConfiguration.Enabled {
518495
volumeMounts = append(volumeMounts, corev1.VolumeMount{
519496
Name: datastreamsTLSVolumeName,

internal/resources/resource.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ const (
7272
localCertsDir = "/usr/local/share/ca-certificates"
7373
systemCertsDir = "/etc/ssl/certs"
7474

75-
encryptionKeyConfigVolumeName = "encryption-config"
76-
encryptionKeySecretVolumeName = "encryption-key"
77-
datastreamsIAMServiceAccountKeyVolumeName = "datastreams-iam-sa-key"
75+
encryptionKeyConfigVolumeName = "encryption-config"
76+
encryptionKeySecretVolumeName = "encryption-key"
7877
)
7978

8079
type ResourceBuilder interface {

0 commit comments

Comments
 (0)