Skip to content

Commit

Permalink
Merge pull request #3673 from pasanw/fix-dex-pol-flake
Browse files Browse the repository at this point in the history
Fix Dex policy test flake
  • Loading branch information
marvin-tigera authored Dec 20, 2024
2 parents 8ee8d1e + 5ab7736 commit c578d0d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/render/dex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package render_test

import (
"encoding/json"
"fmt"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -527,9 +526,14 @@ var _ = Describe("dex rendering tests", func() {

policy := testutils.GetAllowTigeraPolicyFromResources(policyName, resources)
expectedPolicy := getExpectedPolicy(scenario)
policyJ, _ := json.Marshal(policy)
expectedPolicyJ, _ := json.Marshal(expectedPolicy)
Expect(string(policyJ)).To(Equal(string(expectedPolicyJ)))
Expect(policy.Spec.Selector).To(Equal(policy.Spec.Selector))
Expect(policy.Spec.Tier).To(Equal(policy.Spec.Tier))
Expect(policy.Spec.Order).To(Equal(policy.Spec.Order))
Expect(policy.Spec.Types).To(Equal(policy.Spec.Types))

// The order of insertion of rules is not guaranteed by the render implementation.
Expect(policy.Spec.Ingress).To(ContainElements(expectedPolicy.Spec.Ingress))
Expect(policy.Spec.Egress).To(ContainElements(expectedPolicy.Spec.Egress))
},
// Dex only renders in the presence of an Authentication CR, therefore does not have a config option for managed clusters.
Entry("for management/standalone, kube-dns", testutils.AllowTigeraScenario{ManagedCluster: false, OpenShift: false}),
Expand Down

0 comments on commit c578d0d

Please sign in to comment.