diff --git a/go.mod b/go.mod index 8a8770894f88..598db1a1b9c8 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/avast/retry-go v3.0.0+incompatible github.com/aws/aws-sdk-go v1.48.0 - github.com/aws/karpenter-core v0.32.2-0.20231121214117-c23727be4ae6 + github.com/aws/karpenter-core v0.32.2-0.20231122223643-d0156e68fd30 github.com/aws/karpenter/tools/kompat v0.0.0-20231010173459-62c25a3ea85c github.com/go-logr/zapr v1.3.0 github.com/imdario/mergo v0.3.16 diff --git a/go.sum b/go.sum index d420757143c9..ddb16342b4b7 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHS github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-sdk-go v1.48.0 h1:1SeJ8agckRDQvnSCt1dGZYAwUaoD2Ixj6IaXB4LCv8Q= github.com/aws/aws-sdk-go v1.48.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/aws/karpenter-core v0.32.2-0.20231121214117-c23727be4ae6 h1:GCHU/rgMTph307DflPV7GnstyXhBY4EkeuBZtbuJsYg= -github.com/aws/karpenter-core v0.32.2-0.20231121214117-c23727be4ae6/go.mod h1:gK9w/cwNREE8BXh41nEJ9Qsls4E5KalPVgGTdH1Kxaw= +github.com/aws/karpenter-core v0.32.2-0.20231122223643-d0156e68fd30 h1:kasY2OTqjHEbTGyZD22emDCFyb9g4HaVeEhY6VCMZzc= +github.com/aws/karpenter-core v0.32.2-0.20231122223643-d0156e68fd30/go.mod h1:gK9w/cwNREE8BXh41nEJ9Qsls4E5KalPVgGTdH1Kxaw= github.com/aws/karpenter/tools/kompat v0.0.0-20231010173459-62c25a3ea85c h1:oXWwIttmjYLbBKhLazG21aQvpJ3NOOr8IXhCJ/p6e/M= github.com/aws/karpenter/tools/kompat v0.0.0-20231010173459-62c25a3ea85c/go.mod h1:l/TIBsaCx/IrOr0Xvlj/cHLOf05QzuQKEZ1hx2XWmfU= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index 49fc7ae9b786..89516938d2ba 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -43,7 +43,6 @@ import ( "knative.dev/pkg/logging" "sigs.k8s.io/controller-runtime/pkg/client" - nodeclaimutil "github.com/aws/karpenter-core/pkg/utils/nodeclaim" cloudproviderevents "github.com/aws/karpenter/pkg/cloudprovider/events" "github.com/aws/karpenter/pkg/providers/amifamily" "github.com/aws/karpenter/pkg/providers/instance" @@ -194,9 +193,13 @@ func (c *CloudProvider) Delete(ctx context.Context, nodeClaim *corev1beta1.NodeC func (c *CloudProvider) IsDrifted(ctx context.Context, nodeClaim *corev1beta1.NodeClaim) (cloudprovider.DriftReason, error) { // Not needed when GetInstanceTypes removes nodepool dependency - nodePool, err := nodeclaimutil.Owner(ctx, c.kubeClient, nodeClaim) - if err != nil { - return "", client.IgnoreNotFound(fmt.Errorf("resolving owner, %w", err)) + nodePoolName, ok := nodeClaim.Labels[corev1beta1.NodePoolLabelKey] + if !ok { + return "", nil + } + nodePool := &corev1beta1.NodePool{} + if err := c.kubeClient.Get(ctx, types.NamespacedName{Name: nodePoolName}, nodePool); err != nil { + return "", client.IgnoreNotFound(err) } if nodePool.Spec.Template.Spec.NodeClassRef == nil { return "", nil