Skip to content

Commit 7d43a97

Browse files
hughcapetFxKu
andcommitted
Apply suggestions from code review
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
1 parent b0add68 commit 7d43a97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/cluster/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
521521
}
522522
if changed, reason := c.compareAnnotations(c.Statefulset.Spec.VolumeClaimTemplates[i].Annotations, statefulSet.Spec.VolumeClaimTemplates[i].Annotations); changed {
523523
needsReplace = true
524-
reasons = append(reasons, fmt.Sprintf("new statefulset's annotations for volume %q does not match the current one: ", name)+reason)
524+
reasons = append(reasons, fmt.Sprintf("new statefulset's annotations for volume %q does not match the current one: %s", name, reason))
525525
}
526526
if !reflect.DeepEqual(c.Statefulset.Spec.VolumeClaimTemplates[i].Spec, statefulSet.Spec.VolumeClaimTemplates[i].Spec) {
527527
name := c.Statefulset.Spec.VolumeClaimTemplates[i].Name
@@ -826,7 +826,7 @@ func (c *Cluster) compareLogicalBackupJob(cur, new *batchv1.CronJob) (match bool
826826
return true, ""
827827
}
828828

829-
func (c *Cluster) ComparePodDisruptionBudget(cur, new *apipolicyv1.PodDisruptionBudget) (bool, string) {
829+
func (c *Cluster) comparePodDisruptionBudget(cur, new *apipolicyv1.PodDisruptionBudget) (bool, string) {
830830
//TODO: improve comparison
831831
if match := reflect.DeepEqual(new.Spec, cur.Spec); !match {
832832
return false, "new PDB spec does not match the current one"

pkg/cluster/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (c *Cluster) syncPodDisruptionBudget(isUpdate bool) error {
282282
if pdb, err = c.KubeClient.PodDisruptionBudgets(c.Namespace).Get(context.TODO(), c.podDisruptionBudgetName(), metav1.GetOptions{}); err == nil {
283283
c.PodDisruptionBudget = pdb
284284
newPDB := c.generatePodDisruptionBudget()
285-
match, reason := c.ComparePodDisruptionBudget(pdb, newPDB)
285+
match, reason := c.comparePodDisruptionBudget(pdb, newPDB)
286286
if !match {
287287
c.logPDBChanges(pdb, newPDB, isUpdate, reason)
288288
if err = c.updatePodDisruptionBudget(newPDB); err != nil {

0 commit comments

Comments
 (0)