Skip to content

Commit 2b0b2d6

Browse files
committed
Drop the parameter from createOwnerCluster instead of suppressing unparam
1 parent d0e714f commit 2b0b2d6

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

controller/controller_test_helpers_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ func createCloudInitSecret(ctx context.Context, name, namespace, key, value stri
7373
Expect(k8sClient.Create(ctx, secret)).To(Succeed())
7474
}
7575

76-
// Every caller passes the same namespace. This is fine for testing.
77-
//
78-
//nolint:unparam
79-
func createOwnerCluster(ctx context.Context, name, namespace string) {
76+
func createOwnerCluster(ctx context.Context, name string) {
8077
cluster := &clusterv1.Cluster{
81-
ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: namespace},
78+
ObjectMeta: metav1.ObjectMeta{Name: name, Namespace: "default"},
8279
Spec: clusterv1.ClusterSpec{
8380
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
8481
APIGroup: infrav1.GroupVersion.Group,

controller/stackitcluster_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = Describe("StackitCluster Controller", func() {
6060
}
6161

6262
createCredentialsSecret(ctx, credentials, namespace, testProjectID)
63-
createOwnerCluster(ctx, clusterName, namespace)
63+
createOwnerCluster(ctx, clusterName)
6464
stackitClust = newStackitCluster(clusterName, namespace, true)
6565
stackitClust.Spec.CredentialsSecretRef.Name = credentials
6666
Expect(k8sClient.Create(ctx, stackitClust)).To(Succeed())
@@ -208,7 +208,7 @@ var _ = Describe("StackitCluster Controller", func() {
208208
// balancer was gated on its spec flag. A bastion created without its
209209
// status patch landing (process restart, conflict) therefore skipped
210210
// cleanup entirely and leaked server, public IP and security group.
211-
createOwnerCluster(ctx, clusterName+"-nolb", namespace)
211+
createOwnerCluster(ctx, clusterName+"-nolb")
212212
defer deleteIfExists(ctx, &clusterv1.Cluster{
213213
ObjectMeta: metav1.ObjectMeta{Name: clusterName + "-nolb", Namespace: namespace},
214214
})
@@ -251,7 +251,7 @@ var _ = Describe("StackitCluster Controller", func() {
251251
// disappears first during namespace teardown. Broadening the delete gate
252252
// to spec.Bastion.Enabled made a working cloud client mandatory for every
253253
// bastion cluster, which would strand such a cluster in Terminating.
254-
createOwnerCluster(ctx, clusterName+"-nocreds", namespace)
254+
createOwnerCluster(ctx, clusterName+"-nocreds")
255255
defer deleteIfExists(ctx, &clusterv1.Cluster{
256256
ObjectMeta: metav1.ObjectMeta{Name: clusterName + "-nocreds", Namespace: namespace},
257257
})

controller/stackitmachine_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var _ = Describe("StackitMachine Controller", func() {
6767
}
6868

6969
createCredentialsSecret(ctx, credentials, namespace, testProjectID)
70-
createOwnerCluster(ctx, clusterName, namespace)
70+
createOwnerCluster(ctx, clusterName)
7171
createReadyStackitCluster(ctx, clusterName, namespace, credentials)
7272
createOwnerMachine(ctx, machineName, namespace, clusterName, stackitName, nil)
7373
stackitMach = newStackitMachine(stackitName, namespace, machineName)

0 commit comments

Comments
 (0)