diff --git a/go.mod b/go.mod index 8a158af951..7bb41b20c0 100644 --- a/go.mod +++ b/go.mod @@ -10,10 +10,10 @@ require ( github.com/go-logr/logr v1.4.2 github.com/imdario/mergo v0.3.16 github.com/mitchellh/hashstructure/v2 v2.0.2 - github.com/onsi/ginkgo/v2 v2.20.0 + github.com/onsi/ginkgo/v2 v2.20.1 github.com/onsi/gomega v1.34.1 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/prometheus/client_golang v1.20.0 + github.com/prometheus/client_golang v1.20.2 github.com/prometheus/client_model v0.6.1 github.com/samber/lo v1.47.0 go.uber.org/multierr v1.11.0 diff --git a/go.sum b/go.sum index 840780abfb..7cf1a6f833 100644 --- a/go.sum +++ b/go.sum @@ -244,8 +244,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= -github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= +github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= +github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -260,8 +260,8 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= -github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= +github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= diff --git a/pkg/controllers/disruption/suite_test.go b/pkg/controllers/disruption/suite_test.go index b31d4d2546..44d1a80ca3 100644 --- a/pkg/controllers/disruption/suite_test.go +++ b/pkg/controllers/disruption/suite_test.go @@ -637,9 +637,7 @@ var _ = Describe("BuildDisruptionBudgetMapping", func() { budgets, err := disruption.BuildDisruptionBudgets(ctx, cluster, fakeClock, env.Client, recorder) Expect(err).To(Succeed()) // This should not bring in the unmanaged node. - for _, reason := range allKnownDisruptionReasons { - Expect(budgets[nodePool.Name][reason]).To(Equal(10)) - } + Expect(budgets[nodePool.Name][v1.DisruptionReasonAll]).To(Equal(10)) }) It("should not consider nodes that are not initialized as part of disruption count", func() { nodePool.Spec.Disruption.Budgets = []v1.Budget{{Nodes: "100%"}} @@ -668,9 +666,7 @@ var _ = Describe("BuildDisruptionBudgetMapping", func() { budgets, err := disruption.BuildDisruptionBudgets(ctx, cluster, fakeClock, env.Client, recorder) Expect(err).To(Succeed()) // This should not bring in the uninitialized node. - for _, reason := range allKnownDisruptionReasons { - Expect(budgets[nodePool.Name][reason]).To(Equal(10)) - } + Expect(budgets[nodePool.Name][v1.DisruptionReasonAll]).To(Equal(10)) }) It("should not return a negative disruption value", func() { nodePool.Spec.Disruption.Budgets = []v1.Budget{{Nodes: "10%"}} @@ -689,9 +685,7 @@ var _ = Describe("BuildDisruptionBudgetMapping", func() { budgets, err := disruption.BuildDisruptionBudgets(ctx, cluster, fakeClock, env.Client, recorder) Expect(err).To(Succeed()) - for _, reason := range allKnownDisruptionReasons { - Expect(budgets[nodePool.Name][reason]).To(Equal(0)) - } + Expect(budgets[nodePool.Name][v1.DisruptionReasonAll]).To(Equal(0)) }) It("should consider nodes with a deletion timestamp set and MarkedForDeletion to the disruption count", func() { nodePool.Spec.Disruption.Budgets = []v1.Budget{{Nodes: "100%"}} @@ -714,9 +708,8 @@ var _ = Describe("BuildDisruptionBudgetMapping", func() { budgets, err := disruption.BuildDisruptionBudgets(ctx, cluster, fakeClock, env.Client, recorder) Expect(err).To(Succeed()) - for _, reason := range allKnownDisruptionReasons { - Expect(budgets[nodePool.Name][reason]).To(Equal(8)) - } + Expect(budgets[nodePool.Name][v1.DisruptionReasonAll]).To(Equal(8)) + }) It("should consider not ready nodes to the disruption count", func() { nodePool.Spec.Disruption.Budgets = []v1.Budget{{Nodes: "100%"}} @@ -735,9 +728,8 @@ var _ = Describe("BuildDisruptionBudgetMapping", func() { budgets, err := disruption.BuildDisruptionBudgets(ctx, cluster, fakeClock, env.Client, recorder) Expect(err).To(Succeed()) - for _, reason := range allKnownDisruptionReasons { - Expect(budgets[nodePool.Name][reason]).To(Equal(8)) - } + Expect(budgets[nodePool.Name][v1.DisruptionReasonAll]).To(Equal(8)) + }) })