Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/actions/podidentityassociation/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ func (m *Migrator) MigrateToPodIdentity(ctx context.Context, options PodIdentity
}

func IsPodIdentityAgentInstalled(ctx context.Context, eksAPI awsapi.EKS, clusterName string) (bool, error) {
// If the cluster is using "auto mode", don't check for the podIdentity agent addon
clusterOutput, err := eksAPI.DescribeCluster(ctx, &awseks.DescribeClusterInput{
Name: aws.String(clusterName),
})
if err == nil && clusterOutput.Cluster != nil {
if *clusterOutput.Cluster.ComputeConfig.Enabled {
return true, nil
}
}

if _, err := eksAPI.DescribeAddon(ctx, &awseks.DescribeAddonInput{
AddonName: aws.String(api.PodIdentityAgentAddon),
ClusterName: &clusterName,
Expand Down
Loading