Skip to content

Commit

Permalink
Merge branch 'main' into eventual-disruption
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam committed Aug 27, 2024
2 parents a929a2f + 38c2854 commit bd45d05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
22 changes: 7 additions & 15 deletions pkg/controllers/disruption/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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%"}}
Expand Down Expand Up @@ -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%"}}
Expand All @@ -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%"}}
Expand All @@ -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%"}}
Expand All @@ -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))

})
})

Expand Down

0 comments on commit bd45d05

Please sign in to comment.