diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go index 2db4765d06bd..7b46e6116880 100644 --- a/pkg/apis/apis.go +++ b/pkg/apis/apis.go @@ -18,12 +18,10 @@ package apis import ( _ "embed" + "github.com/awslabs/operatorpkg/object" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "github.com/samber/lo" - "sigs.k8s.io/karpenter/pkg/apis" - "sigs.k8s.io/karpenter/pkg/utils/functional" ) //go:generate controller-gen crd object:headerFile="../../hack/boilerplate.go.txt" paths="./..." output:crd:artifacts:config=crds @@ -32,6 +30,6 @@ var ( //go:embed crds/karpenter.k8s.aws_ec2nodeclasses.yaml EC2NodeClassCRD []byte CRDs = append(apis.CRDs, - lo.Must(functional.Unmarshal[apiextensionsv1.CustomResourceDefinition](EC2NodeClassCRD)), + object.Unmarshal[apiextensionsv1.CustomResourceDefinition](EC2NodeClassCRD), ) ) diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index 6a94d9718a2d..c9321a2a3625 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -31,7 +31,6 @@ import ( corev1beta1 "sigs.k8s.io/karpenter/pkg/apis/v1beta1" "sigs.k8s.io/karpenter/pkg/events" "sigs.k8s.io/karpenter/pkg/scheduling" - "sigs.k8s.io/karpenter/pkg/utils/functional" "sigs.k8s.io/karpenter/pkg/utils/resources" "github.com/aws/karpenter-provider-aws/pkg/apis" @@ -322,8 +321,8 @@ func (c *CloudProvider) instanceToNodeClaim(i *instance.Instance, instanceType * } return true } - nodeClaim.Status.Capacity = functional.FilterMap(instanceType.Capacity, resourceFilter) - nodeClaim.Status.Allocatable = functional.FilterMap(instanceType.Allocatable(), resourceFilter) + nodeClaim.Status.Capacity = lo.PickBy(instanceType.Capacity, resourceFilter) + nodeClaim.Status.Allocatable = lo.PickBy(instanceType.Allocatable(), resourceFilter) } labels[v1.LabelTopologyZone] = i.Zone // Attempt to resolve the zoneID from the instance's EC2NodeClass' status condition.