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

Function convertPostgresIDToK8sName

pkg/specs/volumes.go:60–65  ·  view source on GitHub ↗

convertPostgresIDToK8sName returns a postgres identifier without the characters that are illegal in K8s names and domains. (Lowercase RFC 1123)

(tablespaceName string)

Source from the content-addressed store, hash-verified

58// convertPostgresIDToK8sName returns a postgres identifier without the characters
59// that are illegal in K8s names and domains. (Lowercase RFC 1123)
60func convertPostgresIDToK8sName(tablespaceName string) string {
61 name := convertPostgresIDToK8s(tablespaceName)
62 name = strings.ReplaceAll(name, "_", "-") // reversible
63 name = strings.ToLower(name) // irreversible
64 return name
65}
66
67// convertPostgresIDToK8s transforms a postgres identifier to be a valid K8s
68// label.

Callers 3

PvcNameForTablespaceFunction · 0.85

Calls 1

convertPostgresIDToK8sFunction · 0.85

Tested by

no test coverage detected