Skip to content

Commit

Permalink
deps: bump sigs.k8s.io/karpenter
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Aug 12, 2024
1 parent ebe924e commit 92131dd
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/karpenter v0.35.6-0.20240808010858-b7fa3e474e88
sigs.k8s.io/karpenter v0.35.6-0.20240812071010-1fb5534f14d6
sigs.k8s.io/yaml v1.4.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/karpenter v0.35.6-0.20240808010858-b7fa3e474e88 h1:6Aia+dFSz5nTL+BX7CN6m0ivlEMofoK49Z92J6I4fGw=
sigs.k8s.io/karpenter v0.35.6-0.20240808010858-b7fa3e474e88/go.mod h1:yc0tuxIGQ8azrMSJ1KG5IxQ+LoKZ34ayPbo0/nCs0CE=
sigs.k8s.io/karpenter v0.35.6-0.20240812071010-1fb5534f14d6 h1:+PS+Z0vb+ceoir7T6+pe4Y+e1NimqVnxHHs2/Kv1XOE=
sigs.k8s.io/karpenter v0.35.6-0.20240812071010-1fb5534f14d6/go.mod h1:yc0tuxIGQ8azrMSJ1KG5IxQ+LoKZ34ayPbo0/nCs0CE=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
Expand Down
2 changes: 1 addition & 1 deletion test/pkg/environment/common/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (env *Environment) DefaultNodePool(nodeClass *v1beta1.EC2NodeClass) *corev1
},
},
}
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("Never"))
nodePool.Spec.Disruption.ExpireAfter.Duration = nil
nodePool.Spec.Limits = corev1beta1.Limits(v1.ResourceList{
v1.ResourceCPU: resource.MustParse("1000"),
Expand Down
2 changes: 1 addition & 1 deletion test/suites/chaos/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var _ = Describe("Chaos", func() {
defer cancel()

nodePool.Spec.Disruption.ConsolidationPolicy = corev1beta1.ConsolidationPolicyWhenEmpty
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(30 * time.Second)}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("30s"))
numPods := 1
dep := coretest.Deployment(coretest.DeploymentOptions{
Replicas: int32(numPods),
Expand Down
10 changes: 5 additions & 5 deletions test/suites/consolidation/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ var _ = Describe("Consolidation", func() {
})
It("should respect budgets for non-empty delete consolidation", func() {
// This test will hold consolidation until we are ready to execute it
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("Never"))

nodePool = test.ReplaceRequirements(nodePool,
corev1beta1.NodeSelectorRequirementWithMinValues{
Expand Down Expand Up @@ -220,7 +220,7 @@ var _ = Describe("Consolidation", func() {
It("should respect budgets for non-empty replace consolidation", func() {
appLabels := map[string]string{"app": "large-app"}
// This test will hold consolidation until we are ready to execute it
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("Never"))

nodePool = test.ReplaceRequirements(nodePool,
corev1beta1.NodeSelectorRequirementWithMinValues{
Expand Down Expand Up @@ -403,7 +403,7 @@ var _ = Describe("Consolidation", func() {
Disruption: corev1beta1.Disruption{
ConsolidationPolicy: corev1beta1.ConsolidationPolicyWhenUnderutilized,
// Disable Consolidation until we're ready
ConsolidateAfter: &corev1beta1.NillableDuration{},
ConsolidateAfter: lo.ToPtr(corev1beta1.MustParseNillableDuration("Never")),
},
Template: corev1beta1.NodeClaimTemplate{
Spec: corev1beta1.NodeClaimSpec{
Expand Down Expand Up @@ -481,7 +481,7 @@ var _ = Describe("Consolidation", func() {
Disruption: corev1beta1.Disruption{
ConsolidationPolicy: corev1beta1.ConsolidationPolicyWhenUnderutilized,
// Disable Consolidation until we're ready
ConsolidateAfter: &corev1beta1.NillableDuration{},
ConsolidateAfter: lo.ToPtr(corev1beta1.MustParseNillableDuration("Never")),
},
Template: corev1beta1.NodeClaimTemplate{
Spec: corev1beta1.NodeClaimSpec{
Expand Down Expand Up @@ -608,7 +608,7 @@ var _ = Describe("Consolidation", func() {
Disruption: corev1beta1.Disruption{
ConsolidationPolicy: corev1beta1.ConsolidationPolicyWhenUnderutilized,
// Disable Consolidation until we're ready
ConsolidateAfter: &corev1beta1.NillableDuration{},
ConsolidateAfter: lo.ToPtr(corev1beta1.MustParseNillableDuration("Never")),
},
Template: corev1beta1.NodeClaimTemplate{
Spec: corev1beta1.NodeClaimSpec{
Expand Down
16 changes: 8 additions & 8 deletions test/suites/expiration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var _ = BeforeEach(func() {
env.BeforeEach()
nodeClass = env.DefaultEC2NodeClass()
nodePool = env.DefaultNodePool(nodeClass)
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Second * 30)}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("30s")
})

var _ = AfterEach(func() { env.Cleanup() })
Expand Down Expand Up @@ -108,7 +108,7 @@ var _ = Describe("Expiration", func() {
nodePool.Spec.Disruption.Budgets = []corev1beta1.Budget{{
Nodes: "100%",
}}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("Never")

// Create a deployment with one pod to create one node.
dep = coretest.Deployment(coretest.DeploymentOptions{
Expand Down Expand Up @@ -157,7 +157,7 @@ var _ = Describe("Expiration", func() {
env.ExpectUpdated(node)

By("enabling expiration")
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Second * 30)}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("30s")
env.ExpectUpdated(nodePool)

// Expect that both of the nodes are expired, but not being disrupted
Expand Down Expand Up @@ -191,7 +191,7 @@ var _ = Describe("Expiration", func() {
nodePool.Spec.Disruption.Budgets = []corev1beta1.Budget{{
Nodes: "50%",
}}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("Never")

numPods = 6
dep = coretest.Deployment(coretest.DeploymentOptions{
Expand Down Expand Up @@ -232,7 +232,7 @@ var _ = Describe("Expiration", func() {
env.ExpectDeleted(dep)

By("enabling expiration")
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Second * 30)}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("30s")
env.ExpectUpdated(nodePool)

env.EventuallyExpectExpired(nodeClaims...)
Expand Down Expand Up @@ -272,7 +272,7 @@ var _ = Describe("Expiration", func() {
Nodes: "50%",
}}
// disable expiration so that we can enable it later when we want.
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("Never")
numPods = 9
dep = coretest.Deployment(coretest.DeploymentOptions{
Replicas: int32(numPods),
Expand Down Expand Up @@ -318,7 +318,7 @@ var _ = Describe("Expiration", func() {

By("expiring the nodes")
// expire the nodeclaims
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Second * 30)}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("30s")
env.ExpectUpdated(nodePool)

env.EventuallyExpectExpired(nodeClaims...)
Expand Down Expand Up @@ -408,7 +408,7 @@ var _ = Describe("Expiration", func() {
}

By("enabling expiration")
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.NillableDuration{Duration: lo.ToPtr(30 * time.Second)}
nodePool.Spec.Disruption.ExpireAfter = corev1beta1.MustParseNillableDuration("30s")
env.ExpectUpdated(nodePool)

// Ensure that we get two nodes tainted, and they have overlap during the expiration
Expand Down
6 changes: 3 additions & 3 deletions test/suites/integration/emptiness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var _ = Describe("Emptiness", func() {
var numPods int
BeforeEach(func() {
nodePool.Spec.Disruption.ConsolidationPolicy = corev1beta1.ConsolidationPolicyWhenEmpty
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Duration(0))}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("0s"))

numPods = 1
dep = test.Deployment(test.DeploymentOptions{
Expand Down Expand Up @@ -97,7 +97,7 @@ var _ = Describe("Emptiness", func() {
})
})
It("should terminate an empty node", func() {
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Hour * 300)}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("300h"))

const numPods = 1
deployment := test.Deployment(test.DeploymentOptions{Replicas: numPods})
Expand All @@ -116,7 +116,7 @@ var _ = Describe("Emptiness", func() {
env.EventuallyExpectEmpty(nodeClaim)

By("waiting for the nodeclaim to deprovision when past its ConsolidateAfter timeout of 0")
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Duration(0))}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("0s"))
env.ExpectUpdated(nodePool)

env.EventuallyExpectNotFound(nodeClaim, node)
Expand Down
4 changes: 2 additions & 2 deletions test/suites/integration/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ var _ = Describe("Validation", func() {
})
It("should error when ttlSecondAfterEmpty is negative", func() {
nodePool.Spec.Disruption.ConsolidationPolicy = corev1beta1.ConsolidationPolicyWhenEmpty
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(-time.Second)}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("-1s"))
Expect(env.Client.Create(env.Context, nodePool)).ToNot(Succeed())
})
It("should error when ConsolidationPolicy=WhenUnderutilized is used with consolidateAfter", func() {
nodePool.Spec.Disruption.ConsolidationPolicy = corev1beta1.ConsolidationPolicyWhenUnderutilized
nodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{Duration: lo.ToPtr(time.Minute)}
nodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("1m"))
Expect(env.Client.Create(env.Context, nodePool)).ToNot(Succeed())
})
It("should error if imageGCHighThresholdPercent is less than imageGCLowThresholdPercent", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/scale/deprovisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ var _ = Describe("Deprovisioning", Label(debug.NoWatch), Label(debug.NoEvents),
noExpireNodePool := test.NodePool(*nodePool.DeepCopy())

// Disable Expiration
noExpireNodePool.Spec.Disruption.ConsolidateAfter = &corev1beta1.NillableDuration{}
noExpireNodePool.Spec.Disruption.ConsolidateAfter = lo.ToPtr(corev1beta1.MustParseNillableDuration("Never"))
noExpireNodePool.Spec.Disruption.ExpireAfter.Duration = nil

noExpireNodePool.ObjectMeta = metav1.ObjectMeta{Name: test.RandomName()}
Expand Down

0 comments on commit 92131dd

Please sign in to comment.