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

chore(kuma-cp) drop default sufix on the default traffic permission #1155

Merged
merged 1 commit into from
Nov 16, 2020
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
2 changes: 1 addition & 1 deletion pkg/core/managers/apis/mesh/mesh_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ var _ = Describe("Mesh Manager", func() {
Expect(err).ToNot(HaveOccurred())

// and default TrafficPermission for the mesh exists
err = resStore.Get(context.Background(), &core_mesh.TrafficPermissionResource{}, store.GetByKey("allow-all-mesh-1.default", meshName))
err = resStore.Get(context.Background(), &core_mesh.TrafficPermissionResource{}, store.GetByKey("allow-all-mesh-1", meshName))
Expect(err).ToNot(HaveOccurred())
})

Expand Down
4 changes: 1 addition & 3 deletions pkg/defaults/mesh/traffic_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ var defaultTrafficPermission = mesh_proto.TrafficPermission{
},
}

// Default traffic permission needs to be stored with default suffix so on K8S it will be stored in the default namespace
// This will be dropped when TrafficPermission will be converted to Global Scope on K8S instead of Namespace Scope
// TrafficPermission needs to contain mesh name inside it. Otherwise if the name is the same (ex. "allow-all") creating new mesh would fail because there is already resource of name "allow-all" which is unique key on K8S
func defaultTrafficPermissionName(meshName string) string {
return fmt.Sprintf("allow-all-%s.default", meshName)
return fmt.Sprintf("allow-all-%s", meshName)
}

func createDefaultTrafficPermission(resManager manager.ResourceManager, meshName string) error {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/kuma_deploy_hybrid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ metadata:
return stdout, err
}, "10s", "1s").Should(ContainSubstring("HTTP/1.1 200 OK"))

err := global.GetKumactlOptions().KumactlDelete("traffic-permission", "allow-all-default.default") // remove builtin traffic permission
err := global.GetKumactlOptions().KumactlDelete("traffic-permission", "allow-all-default") // remove builtin traffic permission
Expect(err).ToNot(HaveOccurred())

err = YamlUniversal(trafficPermissionAllTo2Remote)(global)
Expand Down