IsReservedEnvironmentVariable detects if a certain environment variable is reserved for the usage of the operator.
(name string)
| 69 | // IsReservedEnvironmentVariable detects if a certain environment variable |
| 70 | // is reserved for the usage of the operator. |
| 71 | func 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. |
no outgoing calls
no test coverage detected