Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(federation): set skipCreatingInitialPolicies on exported Meshes #11501

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/kumactl/cmd/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ $ kumactl export --profile federation --format universal > policies.yaml
if err := rs.List(cmd.Context(), list); err != nil {
return errors.Wrapf(err, "could not list %q", resDesc.Name)
}
allResources = append(allResources, list.GetItems()...)
for _, res := range list.GetItems() {
if res.Descriptor().Name == core_mesh.MeshType {
mesh := res.(*core_mesh.MeshResource)
mesh.Spec.SkipCreatingInitialPolicies = []string{"*"}
}
allResources = append(allResources, res)
}
} else {
for _, mesh := range meshes.Items {
list := resDesc.NewList()
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/export/testdata/export-no-dp.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ creationTime: "0001-01-01T00:00:00Z"
modificationTime: "0001-01-01T00:00:00Z"
name: default
type: Mesh
skipCreatingInitialPolicies:
- '*'
---
creationTime: "0001-01-01T00:00:00Z"
mesh: default
Expand Down
4 changes: 4 additions & 0 deletions app/kumactl/cmd/export/testdata/export.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ creationTime: "0001-01-01T00:00:00Z"
modificationTime: "0001-01-01T00:00:00Z"
name: default
type: Mesh
skipCreatingInitialPolicies:
- '*'
---
creationTime: "0001-01-01T00:00:00Z"
modificationTime: "0001-01-01T00:00:00Z"
name: another-mesh
type: Mesh
skipCreatingInitialPolicies:
- '*'
---
creationTime: "0001-01-01T00:00:00Z"
mesh: default
Expand Down
Loading