Skip to content

Commit

Permalink
fix(tests): invalidates discovery to process our CRDs
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak authored and maistra-bot committed Nov 15, 2022
1 parent 07cd927 commit 9b724e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions tests/integration/servicemesh/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ import (
"istio.io/istio/tests/integration/servicemesh/maistra"
)

var i istio.Instance

func TestMain(m *testing.M) {
// do not change order of setup functions
// nolint: staticcheck
framework.
NewSuite(m).
RequireMaxClusters(1).
Setup(maistra.ApplyServiceMeshCRDs).
Setup(istio.Setup(&i, nil)).
Setup(istio.Setup(nil, nil)).
Setup(maistra.Install).
Run()
}
3 changes: 3 additions & 0 deletions tests/integration/servicemesh/maistra/maistra.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func ApplyServiceMeshCRDs(ctx resource.Context) (err error) {
if err != nil {
return fmt.Errorf("cannot read maistra CRD YAMLs: %s", err)
}

for _, c := range ctx.Clusters().Kube().Primaries() {
for _, crd := range crds {
// we need to manually Create() the CRD because Apply() wants to write its content into an annotation which fails because of size limitations
Expand All @@ -65,6 +66,8 @@ func ApplyServiceMeshCRDs(ctx resource.Context) (err error) {
}
}
}

c.InvalidateDiscovery()
}
return err
}
Expand Down

0 comments on commit 9b724e9

Please sign in to comment.