@@ -72,23 +72,18 @@ func (r ClusterStrategy1) MinorUpgrade(clientset *kubernetes.Clientset, tprclien
7272 //create the master deployment
7373
7474 deploymentFields := DeploymentTemplateFields {
75- Name : cl .Spec .Name ,
76- ClusterName : cl .Spec .Name ,
77- Port : cl .Spec .Port ,
78- CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
79- PVC_NAME : cl .Spec .PVC_NAME ,
80- BACKUP_PVC_NAME : cl .Spec .BACKUP_PVC_NAME ,
81- //PG_MASTER_USER: cl.Spec.PG_MASTER_USER,
82- //PG_MASTER_PASSWORD: cl.Spec.PG_MASTER_PASSWORD,
75+ Name : cl .Spec .Name ,
76+ ClusterName : cl .Spec .Name ,
77+ Port : cl .Spec .Port ,
78+ CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
79+ PVC_NAME : cl .Spec .PVC_NAME ,
80+ BACKUP_PVC_NAME : util .CreateBackupPVCSnippet (cl .Spec .BACKUP_PVC_NAME ),
8381 PGDATA_PATH_OVERRIDE : cl .Spec .Name ,
84- //PG_USER: cl.Spec.PG_USER,
8582 PGROOT_SECRET_NAME : cl .Spec .PGROOT_SECRET_NAME ,
8683 PGUSER_SECRET_NAME : cl .Spec .PGUSER_SECRET_NAME ,
8784 PGMASTER_SECRET_NAME : cl .Spec .PGMASTER_SECRET_NAME ,
88- //PG_PASSWORD: cl.Spec.PG_PASSWORD,
89- PG_DATABASE : cl .Spec .PG_DATABASE ,
90- //PG_ROOT_PASSWORD: cl.Spec.PG_ROOT_PASSWORD,
91- SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
85+ PG_DATABASE : cl .Spec .PG_DATABASE ,
86+ SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
9287 }
9388
9489 err = DeploymentTemplate1 .Execute (& masterDoc , deploymentFields )
@@ -115,23 +110,18 @@ func (r ClusterStrategy1) MinorUpgrade(clientset *kubernetes.Clientset, tprclien
115110
116111 //create the replica deployment
117112 replicaDeploymentFields := DeploymentTemplateFields {
118- Name : replicaName ,
119- ClusterName : cl .Spec .Name ,
120- Port : cl .Spec .Port ,
121- CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
122- PVC_NAME : cl .Spec .PVC_NAME ,
123- PG_MASTER_HOST : cl .Spec .PG_MASTER_HOST ,
124- //PG_MASTER_USER: cl.Spec.PG_MASTER_USER,
125- //PG_MASTER_PASSWORD: cl.Spec.PG_MASTER_PASSWORD,
126- //PG_USER: cl.Spec.PG_USER,
127- //PG_PASSWORD: cl.Spec.PG_PASSWORD,
113+ Name : replicaName ,
114+ ClusterName : cl .Spec .Name ,
115+ Port : cl .Spec .Port ,
116+ CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
117+ PVC_NAME : cl .Spec .PVC_NAME ,
118+ PG_MASTER_HOST : cl .Spec .PG_MASTER_HOST ,
128119 PG_DATABASE : cl .Spec .PG_DATABASE ,
129120 PGROOT_SECRET_NAME : cl .Spec .PGROOT_SECRET_NAME ,
130121 PGUSER_SECRET_NAME : cl .Spec .PGUSER_SECRET_NAME ,
131122 PGMASTER_SECRET_NAME : cl .Spec .PGMASTER_SECRET_NAME ,
132- //PG_ROOT_PASSWORD: cl.Spec.PG_ROOT_PASSWORD,
133- REPLICAS : cl .Spec .REPLICAS ,
134- SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
123+ REPLICAS : cl .Spec .REPLICAS ,
124+ SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
135125 }
136126
137127 err = ReplicaDeploymentTemplate1 .Execute (& replicaDoc , replicaDeploymentFields )
@@ -240,23 +230,18 @@ func (r ClusterStrategy1) MajorUpgradeFinalize(clientset *kubernetes.Clientset,
240230
241231 //start the master deployment
242232 deploymentFields := DeploymentTemplateFields {
243- Name : cl .Spec .Name ,
244- ClusterName : cl .Spec .Name ,
245- Port : cl .Spec .Port ,
246- CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
247- PVC_NAME : upgrade .Spec .NEW_PVC_NAME ,
248- BACKUP_PVC_NAME : upgrade .Spec .BACKUP_PVC_NAME ,
249- //PG_MASTER_USER: cl.Spec.PG_MASTER_USER,
250- //PG_MASTER_PASSWORD: cl.Spec.PG_MASTER_PASSWORD,
233+ Name : cl .Spec .Name ,
234+ ClusterName : cl .Spec .Name ,
235+ Port : cl .Spec .Port ,
236+ CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
237+ PVC_NAME : upgrade .Spec .NEW_PVC_NAME ,
238+ BACKUP_PVC_NAME : util .CreateBackupPVCSnippet (upgrade .Spec .BACKUP_PVC_NAME ),
251239 PGDATA_PATH_OVERRIDE : upgrade .Spec .NEW_DATABASE_NAME ,
252- //PG_USER: cl.Spec.PG_USER,
253- //PG_PASSWORD: cl.Spec.PG_PASSWORD,
254240 PG_DATABASE : cl .Spec .PG_DATABASE ,
255241 PGROOT_SECRET_NAME : cl .Spec .PGROOT_SECRET_NAME ,
256242 PGUSER_SECRET_NAME : cl .Spec .PGUSER_SECRET_NAME ,
257243 PGMASTER_SECRET_NAME : cl .Spec .PGMASTER_SECRET_NAME ,
258- //PG_ROOT_PASSWORD: cl.Spec.PG_ROOT_PASSWORD,
259- SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
244+ SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
260245 }
261246
262247 err = DeploymentTemplate1 .Execute (& masterDoc , deploymentFields )
@@ -284,23 +269,18 @@ func (r ClusterStrategy1) MajorUpgradeFinalize(clientset *kubernetes.Clientset,
284269 //start the replica deployment
285270
286271 replicaDeploymentFields := DeploymentTemplateFields {
287- Name : cl .Spec .Name + REPLICA_SUFFIX ,
288- ClusterName : cl .Spec .Name ,
289- Port : cl .Spec .Port ,
290- CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
291- PVC_NAME : cl .Spec .PVC_NAME ,
292- PG_MASTER_HOST : cl .Spec .PG_MASTER_HOST ,
293- //PG_MASTER_USER: cl.Spec.PG_MASTER_USER,
294- //PG_MASTER_PASSWORD: cl.Spec.PG_MASTER_PASSWORD,
295- //PG_USER: cl.Spec.PG_USER,
296- //PG_PASSWORD: cl.Spec.PG_PASSWORD,
272+ Name : cl .Spec .Name + REPLICA_SUFFIX ,
273+ ClusterName : cl .Spec .Name ,
274+ Port : cl .Spec .Port ,
275+ CCP_IMAGE_TAG : upgrade .Spec .CCP_IMAGE_TAG ,
276+ PVC_NAME : cl .Spec .PVC_NAME ,
277+ PG_MASTER_HOST : cl .Spec .PG_MASTER_HOST ,
297278 PG_DATABASE : cl .Spec .PG_DATABASE ,
298279 PGROOT_SECRET_NAME : cl .Spec .PGROOT_SECRET_NAME ,
299280 PGUSER_SECRET_NAME : cl .Spec .PGUSER_SECRET_NAME ,
300281 PGMASTER_SECRET_NAME : cl .Spec .PGMASTER_SECRET_NAME ,
301- //PG_ROOT_PASSWORD: cl.Spec.PG_ROOT_PASSWORD,
302- REPLICAS : cl .Spec .REPLICAS ,
303- SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
282+ REPLICAS : cl .Spec .REPLICAS ,
283+ SECURITY_CONTEXT : util .CreateSecContext (cl .Spec .FS_GROUP , cl .Spec .SUPPLEMENTAL_GROUPS ),
304284 }
305285
306286 err = ReplicaDeploymentTemplate1 .Execute (& replicaDoc , replicaDeploymentFields )
0 commit comments