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

Function IsReservedEnvironmentVariable

pkg/postgres/environment.go:71–92  ·  view source on GitHub ↗

IsReservedEnvironmentVariable detects if a certain environment variable is reserved for the usage of the operator.

(name string)

Source from the content-addressed store, hash-verified

69// IsReservedEnvironmentVariable detects if a certain environment variable
70// is reserved for the usage of the operator.
71func IsReservedEnvironmentVariable(name string) bool {
72 name = strings.ToUpper(name)
73
74 switch {
75 case strings.HasPrefix(name, "CNPG_"):
76 return true
77
78 case strings.HasPrefix(name, "PG"):
79 return true
80
81 case name == "POD_NAME":
82 return true
83
84 case name == "NAMESPACE":
85 return true
86
87 case name == "CLUSTER_NAME":
88 return true
89 }
90
91 return false
92}
93
94// FindUnknownPlaceholders returns the list of unrecognized ${...} placeholders
95// found in the given value. Escaped placeholders ($${...}) are ignored.

Callers 4

SetEnvVarsFunction · 0.92
validateEnvMethod · 0.92
validateExtensionEnvVarsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected