Skip to content

Commit

Permalink
Merge pull request #9203 from mazdakn/fix-tiers
Browse files Browse the repository at this point in the history
Update comments about tier's default order
  • Loading branch information
caseydavenport committed Aug 30, 2024
2 parents 8da9191 + ff602c5 commit 10641f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions libcalico-go/lib/clientv3/tier_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ var _ = testutils.E2eDatastoreDescribe("Tier tests", testutils.DatastoreAll, fun
_, outError = c.Tiers().Delete(ctx, defaultName, options.DeleteOptions{})
Expect(outError).To(HaveOccurred())
Expect(outError.Error()).To(Equal("operation Delete is not supported on default: Cannot delete default tier"))

By("Getting default Tier")
defRes, outError := c.Tiers().Get(ctx, defaultName, options.GetOptions{})
Expect(outError).NotTo(HaveOccurred())
Expand Down
4 changes: 2 additions & 2 deletions libcalico-go/lib/resources/tier.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
func DefaultTierFields(res *apiv3.Tier) {
// nil order was allowed before, and it was used for the default tier.
// For the implementation of BaselineAdminNetworkPolicy, we need to add a tier
// after the default one. As such, the default tier order is changed to 100,000 from nil.
// after the default one. As such, the default tier order is changed to 1,000,000 from nil.
// To keep the behavior in sync with user defined tiers with nil order, nil order is
// treated similar to the value of 100,000.
// treated similar to the value of 1,000,000.
if res.Spec.Order == nil {
order := apiv3.DefaultTierOrder
res.Spec.Order = &order
Expand Down

0 comments on commit 10641f2

Please sign in to comment.