diff --git a/pkg/controllers/nodeclaim/garbagecollection/controller.go b/pkg/controllers/nodeclaim/garbagecollection/controller.go index 892d9853..aad5f6c4 100644 --- a/pkg/controllers/nodeclaim/garbagecollection/controller.go +++ b/pkg/controllers/nodeclaim/garbagecollection/controller.go @@ -89,7 +89,7 @@ func (c *Controller) Reconcile(ctx context.Context) (reconcile.Result, error) { return reconcile.Result{}, err } c.successfulCount++ - return reconcile.Result{RequeueAfter: lo.Ternary(c.successfulCount <= 20, time.Second*10, time.Minute*2)}, nil + return reconcile.Result{RequeueAfter: lo.Ternary(c.successfulCount <= 20, time.Second*10, time.Minute)}, nil } func (c *Controller) garbageCollect(ctx context.Context, nodeClaim *karpv1.NodeClaim, nodeList *corev1.NodeList) error { diff --git a/pkg/providers/instancetype/instancetype.go b/pkg/providers/instancetype/instancetype.go index b14f2675..a3cf8228 100644 --- a/pkg/providers/instancetype/instancetype.go +++ b/pkg/providers/instancetype/instancetype.go @@ -145,9 +145,17 @@ func (p *DefaultProvider) List(ctx context.Context, kc *v1alpha1.KubeletConfigur ) if item, ok := p.instanceTypesCache.Get(key); ok { - // Ensure what's returned from this function is a shallow-copy of the slice (not a deep-copy of the data itself) - // so that modifications to the ordering of the data don't affect the original - return append([]*cloudprovider.InstanceType{}, item.([]*cloudprovider.InstanceType)...), nil + // TODO: some place changes the Capacity filed, we should find it out and fix it, same with aws provider + return lo.Map(item.([]*cloudprovider.InstanceType), + func(item *cloudprovider.InstanceType, _ int) *cloudprovider.InstanceType { + return &cloudprovider.InstanceType{ + Name: item.Name, + Requirements: item.Requirements, + Offerings: item.Offerings, + Capacity: item.Capacity.DeepCopy(), + Overhead: item.Overhead, + } + }), nil } // Get all zones across all offerings