MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / SanitizeParameters

Function SanitizeParameters

internal/postgres/validation.go:20–24  ·  view source on GitHub ↗

SanitizeParameters transforms parameters so they are safe for Postgres in cluster.

(cluster *v1beta1.PostgresCluster, parameters *ParameterSet, recorder record.EventRecorder)

Source from the content-addressed store, hash-verified

18
19// SanitizeParameters transforms parameters so they are safe for Postgres in cluster.
20func SanitizeParameters(cluster *v1beta1.PostgresCluster, parameters *ParameterSet, recorder record.EventRecorder) {
21 if v, ok := parameters.Get("log_directory"); ok {
22 parameters.Add("log_directory", sanitizeLogDirectory(cluster, v, recorder))
23 }
24}
25
26// sensitiveAbsolutePath matches absolute paths that Postgres expects to control.
27// User input should not direct tools to write to these directories.

Callers 1

Calls 3

sanitizeLogDirectoryFunction · 0.85
GetMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected