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

bug: MatchFields error out if value has forward slash #111

Open
AmitKumarDas opened this issue Mar 18, 2020 · 1 comment
Open

bug: MatchFields error out if value has forward slash #111

AmitKumarDas opened this issue Mar 18, 2020 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed select

Comments

@AmitKumarDas
Copy link
Owner

AmitKumarDas commented Mar 18, 2020

Following MatchFields results in error

ResourceSelector: v1alpha1.ResourceSelector{
	SelectorTerms: []*v1alpha1.SelectorTerm{
		&v1alpha1.SelectorTerm{
			MatchFields: map[string]string{
				"kind":       "StatefulSet",
				"apiVersion": "apps/v1",
			},
		},
	},
},
got [invalid label value: "apps/v1": at key: "apiVersion": a valid label must be an empty string or 
consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric 
character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-
z0-9_.]*)?[A-Za-z0-9])?')
            Invalid field expressions: &LabelSelector{MatchLabels:map[string]string{apiVersion: 
apps/v1,kind: StatefulSet,},MatchExpressions:[]LabelSelectorRequirement{},}
            openebs.io/metac/controller/common/selector.(*Evaluation).isFieldMatch
@AmitKumarDas AmitKumarDas added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed select labels Mar 18, 2020
@AmitKumarDas
Copy link
Owner Author

This error may not happen if client-go & related k8s dependencies are pointed to v0.17.3
Need to write UT as well as update go.mod files to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed select
Projects
None yet
Development

No branches or pull requests

1 participant