Skip to content

Commit b54522b

Browse files
committed
fix isUnavailable
Signed-off-by: Vacant2333 <vacant2333@gmail.com>
1 parent 9fb2451 commit b54522b

File tree

4 files changed

+5898
-635
lines changed

4 files changed

+5898
-635
lines changed

pkg/cache/unavailableofferings.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ import (
2222

2323
"github.com/patrickmn/go-cache"
2424
"knative.dev/pkg/logging"
25-
karpv1 "sigs.k8s.io/karpenter/pkg/apis/v1"
26-
)
27-
28-
var (
29-
spotKey = key("", "", karpv1.CapacityTypeSpot)
3025
)
3126

3227
// UnavailableOfferings stores any offerings that return ICE (insufficient capacity errors) when
@@ -56,11 +51,6 @@ func NewUnavailableOfferings() *UnavailableOfferings {
5651

5752
// IsUnavailable returns true if the offering appears in the cache
5853
func (u *UnavailableOfferings) IsUnavailable(instanceType, zone, capacityType string) bool {
59-
if capacityType == karpv1.CapacityTypeSpot {
60-
if _, found := u.cache.Get(spotKey); found {
61-
return true
62-
}
63-
}
6454
_, found := u.cache.Get(key(instanceType, zone, capacityType))
6555
return found
6656
}

pkg/controllers/interruption/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (c *Controller) Reconcile(ctx context.Context, node *corev1.Node) (reconcil
8585
return reconcile.Result{}, nil
8686
}
8787

88-
func (c *Controller) Register(ctx context.Context, m manager.Manager) error {
88+
func (c *Controller) Register(_ context.Context, m manager.Manager) error {
8989
return controllerruntime.NewControllerManagedBy(m).
9090
Named("interruption").
9191
For(&corev1.Node{}).

pkg/controllers/nodeclaim/garbagecollection/controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ import (
3939
)
4040

4141
type Controller struct {
42-
kubeClient client.Client
43-
cloudProvider cloudprovider.CloudProvider
44-
successfulCount uint64 // keeps track of successful reconciles for more aggressive requeueing near the start of the controller
42+
kubeClient client.Client
43+
cloudProvider cloudprovider.CloudProvider
44+
// Keeps track of successful reconciles for more aggressive requeueing near the start of the controller.
45+
successfulCount uint64
4546
}
4647

4748
func NewController(kubeClient client.Client, cloudProvider cloudprovider.CloudProvider) *Controller {

0 commit comments

Comments
 (0)