Skip to content

Commit 8d2175a

Browse files
fwieselnotandy
authored andcommitted
NodeEvictionLabel: Name eviction like hypervisor
This how it is done in all the other controllers / agents, so normalize it that way.
1 parent 2c224e0 commit 8d2175a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

internal/controller/node_eviction_label_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ func (r *NodeEvictionLabelReconciler) Reconcile(ctx context.Context, req ctrl.Re
6767
}
6868

6969
maintenanceValue, found := node.Labels[labelEvictionRequired]
70-
name := fmt.Sprintf("maintenance-required-%v", hostname)
7170
eviction := &kvmv1.Eviction{
7271
ObjectMeta: metav1.ObjectMeta{
73-
Name: name,
72+
Name: hostname,
7473
},
7574
}
7675

internal/controller/node_eviction_label_controller_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controller
1919

2020
import (
2121
"context"
22-
"fmt"
2322
"os"
2423

2524
"github.com/gophercloud/gophercloud/v2/testhelper"
@@ -135,7 +134,7 @@ var _ = Describe("Node Eviction Label Controller", func() {
135134

136135
// expect node controller to create an eviction for the node
137136
err = k8sClient.Get(ctx, types.NamespacedName{
138-
Name: fmt.Sprintf("maintenance-required-%v", hostName),
137+
Name: hostName,
139138
Namespace: "monsoon3",
140139
}, &kvmv1.Eviction{})
141140
Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)