Skip to content

Commit acc8bfe

Browse files
author
Jeff McCormick
committed
fix --password processing on pgo create cluster command
1 parent 4ca8b53 commit acc8bfe

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

apiserver/clusterservice/clusterimpl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,11 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, userLabel
726726
spec.Policies = request.Policies
727727
}
728728

729-
spec.PrimaryPassword = ""
729+
spec.PrimaryPassword = request.Password
730730
spec.User = "testuser"
731-
spec.Password = ""
731+
spec.Password = request.Password
732732
spec.Database = "userdb"
733-
spec.RootPassword = ""
733+
spec.RootPassword = request.Password
734734
spec.Replicas = "0"
735735
spec.Strategy = "1"
736736
spec.UserLabels = userLabelsMap

conf/apiserver/pgo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Storage:
2323
AccessMode: ReadWriteMany
2424
Size: 200M
2525
StorageType: create
26+
SupplementalGroups: 65534
2627
storage2:
2728
AccessMode: ReadWriteOnce
2829
Size: 333M

operator/cluster/cluster.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ func AddClusterBase(clientset *kubernetes.Clientset, client *rest.RESTClient, cl
169169
}
170170
}
171171

172+
//allows user to override with their own passwords
173+
if cl.Spec.Password != "" {
174+
cl.Spec.RootPassword = cl.Spec.Password
175+
cl.Spec.Password = cl.Spec.Password
176+
cl.Spec.PrimaryPassword = cl.Spec.Password
177+
}
178+
172179
var testPassword string
173180
_, _, testPassword, err = util.CreateDatabaseSecrets(clientset, client, cl, namespace)
174181
if err != nil {
@@ -220,7 +227,7 @@ func AddClusterBase(clientset *kubernetes.Clientset, client *rest.RESTClient, cl
220227

221228
}
222229

223-
// eleteClusterBase ...
230+
// DeleteClusterBase ...
224231
func DeleteClusterBase(clientset *kubernetes.Clientset, client *rest.RESTClient, cl *crv1.Pgcluster, namespace string) {
225232

226233
log.Debug("deleteCluster called with strategy " + cl.Spec.Strategy)

0 commit comments

Comments
 (0)