File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
internal/controllers/machinedeployment Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,10 @@ func TestMachineDeploymentReconciler(t *testing.T) {
92
92
Replicas : pointer .Int32 (2 ),
93
93
RevisionHistoryLimit : pointer .Int32 (0 ),
94
94
Selector : metav1.LabelSelector {
95
- MatchLabels : map [string ]string {
96
- clusterv1 .ClusterLabelName : testCluster .Name ,
97
- },
95
+ // We're using the same labels for spec.selector and spec.template.labels.
96
+ // The labels are later changed and we will use the initial labels later to
97
+ // verify that all original MachineSets have been deleted.
98
+ MatchLabels : labels ,
98
99
},
99
100
Strategy : & clusterv1.MachineDeploymentStrategy {
100
101
Type : clusterv1 .RollingUpdateMachineDeploymentStrategyType ,
@@ -340,8 +341,8 @@ func TestMachineDeploymentReconciler(t *testing.T) {
340
341
// expect old MachineSets with old labels to be deleted
341
342
//
342
343
oldLabels := deployment .Spec .Selector .MatchLabels
343
- oldLabels [clusterv1 .MachineDeploymentLabelName ] = deployment .Name
344
344
345
+ // Change labels and selector to a new set of labels which doesn't have any overlap with the previous labels.
345
346
newLabels := map [string ]string {
346
347
"new-key" : "new-value" ,
347
348
clusterv1 .ClusterLabelName : testCluster .Name ,
You can’t perform that action at this time.
0 commit comments