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

Function getDatabasUserUID

tests/e2e/tablespaces_test.go:1018–1023  ·  view source on GitHub ↗

if there's a security context with a specific UID to use for the DB, use it, otherwise use the default postgres UID

(cluster *apiv1.Cluster, dbContainer *corev1.Container)

Source from the content-addressed store, hash-verified

1016// if there's a security context with a specific UID to use for the DB, use it,
1017// otherwise use the default postgres UID
1018func getDatabasUserUID(cluster *apiv1.Cluster, dbContainer *corev1.Container) int64 {
1019 if dbContainer.SecurityContext.RunAsUser != nil {
1020 return *dbContainer.SecurityContext.RunAsUser
1021 }
1022 return cluster.GetPostgresUID()
1023}
1024
1025func AssertClusterHasPvcsAndDataDirsForTablespaces(cluster *apiv1.Cluster, timeout int) {
1026 namespace := cluster.Namespace

Calls 1

GetPostgresUIDMethod · 0.80

Tested by

no test coverage detected