diff --git a/go.mod b/go.mod index a3df78b3dc95..3f4580be45e5 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,8 @@ require ( sigs.k8s.io/karpenter v0.33.1-0.20240112201343-c383004c469a ) +replace sigs.k8s.io/karpenter => github.com/jonathan-innis/karpenter v0.0.4-0.20240116064108-312eb002bdd0 + require ( contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect @@ -110,7 +112,7 @@ require ( k8s.io/cloud-provider v0.29.0 // indirect k8s.io/component-base v0.29.0 // indirect k8s.io/csi-translation-lib v0.29.0 // indirect - k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/klog/v2 v2.120.0 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/go.sum b/go.sum index 34cadb7366fc..2833a00966b7 100644 --- a/go.sum +++ b/go.sum @@ -114,7 +114,6 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -222,6 +221,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonathan-innis/karpenter v0.0.4-0.20240116064108-312eb002bdd0 h1:P6cKG/atuW03lg2QU7UWJN1hJo7HWMtyLbPgs+TLdK4= +github.com/jonathan-innis/karpenter v0.0.4-0.20240116064108-312eb002bdd0/go.mod h1:ExeDTBVknsbC9x9K4/9gwrTt1Mo9HgMaV1NHPELHQPw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -748,8 +749,8 @@ k8s.io/component-base v0.29.0 h1:T7rjd5wvLnPBV1vC4zWd/iWRbV8Mdxs+nGaoaFzGw3s= k8s.io/component-base v0.29.0/go.mod h1:sADonFTQ9Zc9yFLghpDpmNXEdHyQmFIGbiuZbqAXQ1M= k8s.io/csi-translation-lib v0.29.0 h1:we4X1yUlDikvm5Rv0dwMuPHNw6KwjwsQiAuOPWXha8M= k8s.io/csi-translation-lib v0.29.0/go.mod h1:Cp6t3CNBSm1dXS17V8IImUjkqfIB6KCj8Fs8wf6uyTA= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/klog/v2 v2.120.0 h1:z+q5mfovBj1fKFxiRzsa2DsJLPIVMk/KFL81LMOfK+8= +k8s.io/klog/v2 v2.120.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= @@ -763,8 +764,6 @@ sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigw sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/karpenter v0.33.1-0.20240112201343-c383004c469a h1:EuQ5KFs1PHLfPTGJV+0/EnMkdYBaPgt5CCLKWzwjfGE= -sigs.k8s.io/karpenter v0.33.1-0.20240112201343-c383004c469a/go.mod h1:h/O8acLmwFmYYmDD9b57+Fknlf7gQThuY19l7jpThYs= 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.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/test/pkg/environment/common/expectations.go b/test/pkg/environment/common/expectations.go index 82271a82a62f..ac368fcbf0c4 100644 --- a/test/pkg/environment/common/expectations.go +++ b/test/pkg/environment/common/expectations.go @@ -391,9 +391,9 @@ func (env *Environment) EventuallyExpectBoundPodCount(selector labels.Selector, res = []*v1.Pod{} podList := &v1.PodList{} g.Expect(env.Client.List(env.Context, podList)).To(Succeed()) - for _, pod := range podList.Items { - if selector.Matches(labels.Set(pod.Labels)) && pod.Spec.NodeName != "" { - res = append(res, &pod) + for i := range podList.Items { + if selector.Matches(labels.Set(podList.Items[i].Labels)) && podList.Items[i].Spec.NodeName != "" { + res = append(res, &podList.Items[i]) } } g.Expect(res).To(HaveLen(numPods)) @@ -503,7 +503,7 @@ func (env *Environment) ConsistentlyExpectNoDisruptions(nodeCount int, duration }) g.Expect(ok).To(BeFalse()) } - }, "1m").Should(Succeed()) + }, duration).Should(Succeed()) } func (env *Environment) EventuallyExpectTaintedNodeCount(comparator string, count int) []*v1.Node { diff --git a/test/suites/drift/suite_test.go b/test/suites/drift/suite_test.go index 6faf586a13a3..d3d600363c29 100644 --- a/test/suites/drift/suite_test.go +++ b/test/suites/drift/suite_test.go @@ -791,7 +791,7 @@ var _ = Describe("Drift", func() { g.Expect(sets.New(nodeClaimUIDs...).IsSuperset(sets.New(startingNodeClaimUIDs...))).To(BeTrue()) }, "2m").Should(Succeed()) }) - It("should not expire any nodes if their PodDisruptionBudgets are unhealthy", func() { + It("should not drift any nodes if their PodDisruptionBudgets are unhealthy", func() { // Create a deployment that contains a readiness probe that will never succeed // This way, the pod will bind to the node, but the PodDisruptionBudget will never go healthy var numPods int32 = 2 @@ -829,6 +829,10 @@ var _ = Describe("Drift", func() { // Expect pods to be bound but not to be ready since we are intentionally failing the readiness check env.EventuallyExpectBoundPodCount(selector, int(numPods)) + // Drift the nodeclaims + nodePool.Spec.Template.Annotations = map[string]string{"test": "annotation"} + env.ExpectUpdated(nodePool) + env.EventuallyExpectDrifted(nodeClaims...) env.ConsistentlyExpectNoDisruptions(int(numPods), "1m") })