MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / backupSecrets

Function backupSecrets

pkg/specs/roles.go:413–449  ·  view source on GitHub ↗
(cluster *apiv1.Cluster, backupOrigin *apiv1.Backup)

Source from the content-addressed store, hash-verified

411}
412
413func backupSecrets(cluster *apiv1.Cluster, backupOrigin *apiv1.Backup) []string {
414 var result []string
415
416 // Secrets needed to access S3 and Azure
417 if cluster.Spec.Backup != nil && cluster.Spec.Backup.BarmanObjectStore != nil {
418 result = append(
419 result,
420 s3CredentialsSecrets(cluster.Spec.Backup.BarmanObjectStore.AWS)...)
421 result = append(
422 result,
423 azureCredentialsSecrets(cluster.Spec.Backup.BarmanObjectStore.Azure)...)
424 result = append(
425 result,
426 googleCredentialsSecrets(cluster.Spec.Backup.BarmanObjectStore.Google)...)
427 }
428
429 // Secrets needed by Barman, if set
430 if cluster.Spec.Backup.IsBarmanEndpointCASet() {
431 result = append(
432 result,
433 cluster.Spec.Backup.BarmanObjectStore.EndpointCA.Name)
434 }
435
436 if backupOrigin != nil {
437 result = append(
438 result,
439 s3CredentialsSecrets(backupOrigin.Status.AWS)...)
440 result = append(
441 result,
442 azureCredentialsSecrets(backupOrigin.Status.Azure)...)
443 result = append(
444 result,
445 googleCredentialsSecrets(backupOrigin.Status.Google)...)
446 }
447
448 return result
449}
450
451func azureCredentialsSecrets(azureCredentials *apiv1.AzureCredentials) []string {
452 var result []string

Callers 2

roles_test.goFile · 0.85
getInvolvedSecretNamesFunction · 0.85

Calls 4

s3CredentialsSecretsFunction · 0.85
azureCredentialsSecretsFunction · 0.85
googleCredentialsSecretsFunction · 0.85
IsBarmanEndpointCASetMethod · 0.80

Tested by

no test coverage detected