Skip to content

Commit 75ccd55

Browse files
authored
Merge pull request #4292 from faiq/faiq/remove-set-role
fix: remove set nodes role
2 parents 8aa6461 + 6d908b4 commit 75ccd55

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

pkg/cloud/services/iamauth/reconcile.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
3131
ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/eks/api/v1beta2"
3232
expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2"
33-
iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1"
3433
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3534
expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
3635
)
@@ -105,11 +104,7 @@ func (s *Service) getARNForRole(role string) (string, error) {
105104
}
106105

107106
func (s *Service) getRolesForWorkers(ctx context.Context) (map[string]struct{}, error) {
108-
// previously this was the default role always added to the IAM authenticator config
109-
// we'll keep this to not break existing behavior for users
110-
allRoles := map[string]struct{}{
111-
fmt.Sprintf("nodes%s", iamv1.DefaultNameSuffix): {},
112-
}
107+
allRoles := map[string]struct{}{}
113108
if err := s.getRolesForMachineDeployments(ctx, allRoles); err != nil {
114109
return nil, fmt.Errorf("failed to get roles from machine deployments %w", err)
115110
}

test/e2e/suites/managed/cluster.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ func ManagedClusterSpec(ctx context.Context, inputGetter func() ManagedClusterSp
101101
verifySecretExists(ctx, fmt.Sprintf("%s-kubeconfig", input.ClusterName), input.Namespace.Name, bootstrapClient)
102102
verifySecretExists(ctx, fmt.Sprintf("%s-user-kubeconfig", input.ClusterName), input.Namespace.Name, bootstrapClient)
103103

104-
ginkgo.By("Checking that aws-iam-authenticator config map exists")
105-
workloadClusterProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName)
106-
workloadClient := workloadClusterProxy.GetClient()
107-
verifyConfigMapExists(ctx, "aws-auth", metav1.NamespaceSystem, workloadClient)
104+
// this will not be created unless there are worker machines or set by IAMAuthenticatorConfig on the managed control plane spec
105+
if input.WorkerMachineCount > 0 {
106+
ginkgo.By("Checking that aws-iam-authenticator config map exists")
107+
workloadClusterProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Namespace.Name, input.ClusterName)
108+
workloadClient := workloadClusterProxy.GetClient()
109+
verifyConfigMapExists(ctx, "aws-auth", metav1.NamespaceSystem, workloadClient)
110+
}
108111
}
109112

110113
// DeleteClusterSpecInput is the input to DeleteClusterSpec.

test/e2e/suites/managed/eks_ipv6_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var _ = ginkgo.Describe("[managed] [general] [ipv6] EKS cluster tests", func() {
7272
ClusterName: clusterName,
7373
Flavour: EKSIPv6ClusterFlavor,
7474
ControlPlaneMachineCount: 1, //NOTE: this cannot be zero as clusterctl returns an error
75-
WorkerMachineCount: 1,
75+
WorkerMachineCount: 0,
7676
}
7777
})
7878

test/e2e/suites/managed/upgrade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var _ = ginkgo.Describe("EKS Cluster upgrade test", func() {
7070
ClusterName: clusterName,
7171
Flavour: EKSControlPlaneOnlyFlavor, // TODO (richardcase) - change in the future when upgrades to machinepools work
7272
ControlPlaneMachineCount: 1, // NOTE: this cannot be zero as clusterctl returns an error
73-
WorkerMachineCount: 1,
73+
WorkerMachineCount: 0,
7474
KubernetesVersion: initialVersion,
7575
}
7676
})

0 commit comments

Comments
 (0)