diff --git a/charts/karpenter/templates/clusterrole-core.yaml b/charts/karpenter/templates/clusterrole-core.yaml index edb7ca93d54e..bc12a8a70ab7 100644 --- a/charts/karpenter/templates/clusterrole-core.yaml +++ b/charts/karpenter/templates/clusterrole-core.yaml @@ -44,7 +44,7 @@ rules: - apiGroups: ["policy"] resources: ["poddisruptionbudgets"] verbs: ["get", "list", "watch"] - - apiGroups: [] + - apiGroups: [""] resources: ["events"] verbs: ["get", list, "watch"] # Write diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index e4541906425d..45db942c331b 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -157,7 +157,7 @@ func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error) { Values: []string{v1.NodeClassTagKey}, }, { - Name: aws.String(v1.EKSClusterNameTagKey), + Name: aws.String(fmt.Sprintf("tag:%s", v1.EKSClusterNameTagKey)), Values: []string{options.FromContext(ctx).ClusterName}, }, instanceStateFilter, @@ -166,10 +166,10 @@ func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error) { for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) - out.Reservations = append(out.Reservations, page.Reservations...) if err != nil { return nil, fmt.Errorf("describing ec2 instances, %w", err) } + out.Reservations = append(out.Reservations, page.Reservations...) } instances, err := instancesFromOutput(out) return instances, cloudprovider.IgnoreNodeClaimNotFoundError(err)