Skip to content

Commit

Permalink
fix(e2e): properly cleanup policies after envoyconfig test (#12711)
Browse files Browse the repository at this point in the history
<!--
> Changelog: skip
-->
<!--
Uncomment the above section to explicitly set a [`> Changelog:` entry
here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)?
-->

---------

Signed-off-by: Marcin Skalski <[email protected]>
  • Loading branch information
Automaat authored Jan 30, 2025
1 parent be6df1b commit 9b8eddd
Show file tree
Hide file tree
Showing 5 changed files with 1,834 additions and 1,838 deletions.
20 changes: 8 additions & 12 deletions test/e2e_env/universal/envoyconfig/envoyconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
"github.com/kumahq/kuma/api/openapi/types"
api_common "github.com/kumahq/kuma/api/openapi/types/common"
meshaccesslog "github.com/kumahq/kuma/pkg/plugins/policies/meshaccesslog/api/v1alpha1"
meshtimeout "github.com/kumahq/kuma/pkg/plugins/policies/meshtimeout/api/v1alpha1"
"github.com/kumahq/kuma/pkg/test"
"github.com/kumahq/kuma/pkg/test/matchers"
"github.com/kumahq/kuma/pkg/test/resources/builders"
Expand Down Expand Up @@ -60,18 +62,12 @@ func EnvoyConfigTest() {
})

E2EAfterEach(func() {
// delete all meshtimeout policies
out, err := universal.Cluster.GetKumactlOptions().RunKumactlAndGetOutput("get", "meshtimeouts", "--mesh", meshName, "-o", "json")
Expect(err).ToNot(HaveOccurred())
var output struct {
Items []struct {
Name string `json:"name"`
} `json:"items"`
}
Expect(json.Unmarshal([]byte(out), &output)).To(Succeed())
for _, item := range output.Items {
Expect(universal.Cluster.GetKumactlOptions().RunKumactl("delete", "meshtimeout", item.Name, "--mesh", meshName)).To(Succeed())
}
Expect(DeleteMeshResources(
universal.Cluster,
meshName,
meshtimeout.MeshTimeoutResourceTypeDescriptor,
meshaccesslog.MeshAccessLogResourceTypeDescriptor,
)).To(Succeed())
})

getConfig := func(dpp string) string {
Expand Down
Loading

0 comments on commit 9b8eddd

Please sign in to comment.