use pointer type for nodeAffinity (#1263)

* use pointer type for nodeAffinity
This commit is contained in:
Felix Kunde
2020-12-18 12:07:59 +01:00
committed by GitHub
parent a63ad49ef8
commit 07c4f52ede
6 changed files with 12 additions and 8 deletions
+3 -3
View File
@@ -113,9 +113,9 @@ func New(cfg Config, kubeClient k8sutil.KubernetesClient, pgSpec acidv1.Postgres
return fmt.Sprintf("%s-%s", e.PodName, e.ResourceVersion), nil
})
password_encryption, ok := pgSpec.Spec.PostgresqlParam.Parameters["password_encryption"]
passwordEncryption, ok := pgSpec.Spec.PostgresqlParam.Parameters["password_encryption"]
if !ok {
password_encryption = "md5"
passwordEncryption = "md5"
}
cluster := &Cluster{
@@ -128,7 +128,7 @@ func New(cfg Config, kubeClient k8sutil.KubernetesClient, pgSpec acidv1.Postgres
Secrets: make(map[types.UID]*v1.Secret),
Services: make(map[PostgresRole]*v1.Service),
Endpoints: make(map[PostgresRole]*v1.Endpoints)},
userSyncStrategy: users.DefaultUserSyncStrategy{PasswordEncryption: password_encryption},
userSyncStrategy: users.DefaultUserSyncStrategy{PasswordEncryption: passwordEncryption},
deleteOptions: metav1.DeleteOptions{PropagationPolicy: &deletePropagationPolicy},
podEventsQueue: podEventsQueue,
KubeClient: kubeClient,
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"github.com/zalando/postgres-operator/pkg/util/k8sutil"
)
// K8S objects that are belong to connection pooler
// ConnectionPoolerObjects K8s objects that are belong to connection pooler
type ConnectionPoolerObjects struct {
Deployment *appsv1.Deployment
Service *v1.Service
+1 -1
View File
@@ -1223,7 +1223,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
effectiveRunAsUser,
effectiveRunAsGroup,
effectiveFSGroup,
nodeAffinity(c.OpConfig.NodeReadinessLabel, &spec.NodeAffinity),
nodeAffinity(c.OpConfig.NodeReadinessLabel, spec.NodeAffinity),
spec.SchedulerName,
int64(c.OpConfig.PodTerminateGracePeriod.Seconds()),
c.OpConfig.PodServiceAccountName,
+1 -1
View File
@@ -882,7 +882,7 @@ func TestNodeAffinity(t *testing.T) {
Volume: acidv1.Volume{
Size: "1G",
},
NodeAffinity: *nodeAffinity,
NodeAffinity: nodeAffinity,
}
}