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

feat(kuma-cp): allow sectionName and labels in targetRef #11819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions pkg/core/resources/apis/mesh/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ func ValidateTargetRef(
if len(ref.Labels) > 0 && (ref.Name != "" || ref.Namespace != "") {
err.AddViolation("labels", "either labels or name and namespace must be specified")
}
if len(ref.Labels) > 0 && ref.SectionName != "" {
err.AddViolation("sectionName", "sectionName should not be combined with labels")
}
case common_api.MeshServiceSubset, common_api.MeshGateway:
err.Add(requiredField("name", ref.Name, ref.Kind))
err.Add(validateName(ref.Name, opts.AllowedInvalidNames))
Expand Down
18 changes: 0 additions & 18 deletions pkg/core/resources/apis/mesh/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,24 +812,6 @@ namespace: test-ns
violations:
- field: targetRef.name
message: must be set with kind MeshService
`,
}),
Entry("MeshService should not have sectionName when labels are set", testCase{
inputYaml: `
kind: MeshService
sectionName: http-port
labels:
kuma.io/zone: east
`,
opts: &ValidateTargetRefOpts{
SupportedKinds: []common_api.TargetRefKind{
common_api.MeshService,
},
},
expected: `
violations:
- field: targetRef.sectionName
message: sectionName should not be combined with labels
`,
}),
Entry("Mesh should not be used with namespace or labels or sectionName", testCase{
Expand Down
Loading