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

Method defaultTablespaces

api/v1/cluster_defaults.go:168–180  ·  view source on GitHub ↗

defaultTablespaces adds the tablespace owner where the user didn't specify it

()

Source from the content-addressed store, hash-verified

166// defaultTablespaces adds the tablespace owner where the
167// user didn't specify it
168func (r *Cluster) defaultTablespaces() {
169 defaultOwner := r.GetApplicationDatabaseOwner()
170 if len(defaultOwner) == 0 {
171 defaultOwner = "postgres"
172 }
173
174 for name, tablespaceConfiguration := range r.Spec.Tablespaces {
175 if len(tablespaceConfiguration.Owner.Name) == 0 {
176 tablespaceConfiguration.Owner.Name = defaultOwner
177 }
178 r.Spec.Tablespaces[name] = tablespaceConfiguration
179 }
180}
181
182// defaultMonitoringQueries adds the default monitoring queries configMap
183// if not already present in CustomQueriesConfigMap

Callers 1

setDefaultsMethod · 0.95

Calls 1

Tested by

no test coverage detected