mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 23:21:33 +02:00
Add pod_environment_secret secrets to be injected to all clusters.
A potential mechanism to provide secrets to custom sidecars. Right now it is WIP and only provid secrets to Spilo Pods.
This commit is contained in:
@@ -33,6 +33,7 @@ type Resources struct {
|
||||
DefaultCPULimit string `name:"default_cpu_limit" default:"3"`
|
||||
DefaultMemoryLimit string `name:"default_memory_limit" default:"1Gi"`
|
||||
PodEnvironmentConfigMap string `name:"pod_environment_configmap" default:""`
|
||||
PodEnvironmentSecret string `name:"pod_environment_secret" default:""`
|
||||
NodeReadinessLabel map[string]string `name:"node_readiness_label" default:""`
|
||||
MaxInstances int32 `name:"max_instances" default:"-1"`
|
||||
MinInstances int32 `name:"min_instances" default:"-1"`
|
||||
|
||||
@@ -3,6 +3,7 @@ package k8sutil
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"regexp"
|
||||
|
||||
apiextclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
||||
apiextbeta1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1"
|
||||
@@ -22,6 +23,14 @@ import (
|
||||
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
EnvironmentNameRegexpString = "[-._a-zA-Z][-._a-zA-Z0-9]*"
|
||||
)
|
||||
|
||||
var (
|
||||
environmentNameRegexp = regexp.MustCompile(EnvironmentNameRegexpString)
|
||||
)
|
||||
|
||||
// KubernetesClient describes getters for Kubernetes objects
|
||||
type KubernetesClient struct {
|
||||
v1core.SecretsGetter
|
||||
@@ -153,3 +162,7 @@ func SamePDB(cur, new *policybeta1.PodDisruptionBudget) (match bool, reason stri
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func EnvironmentVariableNameIsValid(name string) bool {
|
||||
return environmentNameRegexp.MatchString(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user