Skip to content

Commit 672c550

Browse files
wilybracejkatz
authored andcommitted
removes unused Clusteridentifier field
The Clusteridentifier field was added for a future event client requirement to uniquely identify the underlying cluster. The current implementation does not return Clusteridentifier content with the message as nothing is populating the pg-cluster-id is not being set. Any direct usage of the field in dependent code will fail compilation.
1 parent a12aca2 commit 672c550

File tree

18 files changed

+108
-168
lines changed

18 files changed

+108
-168
lines changed

apiserver/clusterservice/clusterimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ func TestCluster(name, selector, ns, pgouser string, allFlag bool) msgs.ClusterT
406406
EventType: events.EventTestCluster,
407407
},
408408
Clustername: c.Name,
409-
Clusteridentifier: c.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
410409
}
411410

412411
err = events.Publish(f)

apiserver/labelservice/labelimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ func addLabels(items []crv1.Pgcluster, DryRun bool, LabelCmdLabel string, newLab
140140
EventType: events.EventCreateLabel,
141141
},
142142
Clustername: items[i].Spec.Name,
143-
Clusteridentifier: items[i].ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
144143
Label: LabelCmdLabel,
145144
}
146145

apiserver/loadservice/loadimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ func Load(request *msgs.LoadRequest, ns, pgouser string) msgs.LoadResponse {
196196
EventType: events.EventLoad,
197197
},
198198
Clustername: c.Name,
199-
Clusteridentifier: c.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
200199
Loadconfig: LoadCfg.TableToLoad,
201200
}
202201

apiserver/policyservice/policyimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ func ApplyPolicy(request *msgs.ApplyPolicyRequest, ns, pgouser string) msgs.Appl
275275
EventType: events.EventApplyPolicy,
276276
},
277277
Clustername: d.ObjectMeta.Labels[config.LABEL_PG_CLUSTER],
278-
Clusteridentifier: d.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
279278
Policyname: request.Name,
280279
}
281280

apiserver/reloadservice/reloadimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ func Reload(request *msgs.ReloadRequest, ns, username string) msgs.ReloadRespons
119119
EventType: events.EventReloadCluster,
120120
},
121121
Clustername: cluster.Spec.Name,
122-
Clusteridentifier: cluster.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
123122
}
124123

125124
err = events.Publish(f)

apiserver/userservice/userimpl.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ func UpdateUser(request *msgs.UpdateUserRequest, pgouser string) msgs.UpdateUser
220220
EventType: events.EventChangePasswordUser,
221221
},
222222
Clustername: cluster.Spec.Name,
223-
Clusteridentifier: cluster.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
224223
PostgresUsername: request.Username,
225224
PostgresPassword: request.Password,
226225
}
@@ -756,7 +755,6 @@ func CreateUser(request *msgs.CreateUserRequest, pgouser string) msgs.CreateUser
756755
PostgresUsername: request.Username,
757756
PostgresPassword: newPassword,
758757
Managed: request.ManagedUser,
759-
Clusteridentifier: c.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
760758
}
761759

762760
err = events.Publish(f)
@@ -897,7 +895,6 @@ func DeleteUser(request *msgs.DeleteUserRequest, pgouser string) msgs.DeleteUser
897895
Clustername: clusterName,
898896
PostgresUsername: request.Username,
899897
Managed: managed,
900-
Clusteridentifier: cluster.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
901898
}
902899

903900
err = events.Publish(f)

controller/jobcontroller.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ func (c *JobController) onUpdate(oldObj, newObj interface{}) {
310310
EventType: events.EventBenchmarkCompleted,
311311
},
312312
Clustername: labels[config.LABEL_PG_CLUSTER],
313-
Clusteridentifier: labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
314313
}
315314

316315
err = events.Publish(f)
@@ -472,7 +471,6 @@ func publishBackupComplete(clusterName, clusterIdentifier, username, backuptype,
472471
EventType: events.EventCreateBackupCompleted,
473472
},
474473
Clustername: clusterName,
475-
Clusteridentifier: clusterIdentifier,
476474
BackupType: backuptype,
477475
Path: path,
478476
}
@@ -496,7 +494,6 @@ func publishRestoreComplete(clusterName, identifier, username, namespace string)
496494
EventType: events.EventRestoreClusterCompleted,
497495
},
498496
Clustername: clusterName,
499-
Clusteridentifier: identifier,
500497
}
501498

502499
err := events.Publish(f)
@@ -519,7 +516,6 @@ func publishDeleteClusterComplete(clusterName, identifier, username, namespace s
519516
EventType: events.EventDeleteClusterCompleted,
520517
},
521518
Clustername: clusterName,
522-
Clusteridentifier: identifier,
523519
}
524520

525521
err := events.Publish(f)

controller/podcontroller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ func publishClusterComplete(clusterName, namespace string, cluster *crv1.Pgclust
409409
EventType: events.EventCreateClusterCompleted,
410410
},
411411
Clustername: clusterName,
412-
Clusteridentifier: cluster.ObjectMeta.Labels[config.LABEL_PG_CLUSTER_IDENTIFIER],
413412
WorkflowID: cluster.Spec.UserLabels[config.LABEL_WORKFLOW_ID],
414413
}
415414

@@ -473,7 +472,6 @@ func publishPrimaryNotReady(clusterName, identifier, username, namespace string)
473472
EventType: events.EventPrimaryNotReady,
474473
},
475474
Clustername: clusterName,
476-
Clusteridentifier: identifier,
477475
}
478476

479477
err := events.Publish(f)

0 commit comments

Comments
 (0)