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

Make label and field selector query strings versionable. #5233

Merged
merged 1 commit into from
Mar 16, 2015

Conversation

brendandburns
Copy link
Contributor

@bgrant0607

See #2131 for some context.

I know the unit tests are broken. If this LGTM to folks, I will fix them.

@bgrant0607
Copy link
Member

cc @lavalamp

@bgrant0607
Copy link
Member

Thanks. API change LGTM. I'm in favor of renaming the query parameters to "label-selector" and "field-selector". I suppose reverse lookup would be "selector-target-labels" or somesuch.

Delegating detailed review to others.

We should also clarify kubectl flags at some point.

@bgrant0607
Copy link
Member

BTW, bonus points for making these consistent across list operations and/or documented using go-restful.

@@ -124,19 +124,19 @@ type FakeRESTClient struct {
}

func (c *FakeRESTClient) Get() *Request {
return NewRequest(c, "GET", &url.URL{Host: "localhost"}, c.Codec, c.Legacy, c.Legacy)
return NewRequest(c, "GET", &url.URL{Host: "localhost"}, "v1beta1", c.Codec, c.Legacy, c.Legacy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will recommend using testapi.Version() or latest.Version rather than hardcoding v1beta1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@brendandburns
Copy link
Contributor Author

Comments addressed. Please take a look.

@@ -110,6 +110,8 @@ type Request struct {
selector labels.Selector
timeout time.Duration

apiVersion string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be used anywhere.
Is this change required? Or am I missing something.

@nikhiljindal
Copy link
Contributor

LGTM.
@bgrant0607 Is this fine now (now that we are using api.LabelSelectorQueryParam()) or do you still think that we should be passing the strings to apiserver from pkg/master.

@bgrant0607
Copy link
Member

LGTM for now.

bgrant0607 added a commit that referenced this pull request Mar 16, 2015
Make label and field selector query strings versionable.
@bgrant0607 bgrant0607 merged commit 2f9a41b into kubernetes:master Mar 16, 2015
@smarterclayton
Copy link
Contributor

I'm currently fixing and refactoring some of this, but I don't think we should be using "field-selector". In brief, we already use "resourceVersion", I'd like this to be consistent with our field naming ("fieldSelector" would be the JSON name), and we're using camelCase in field labels.

If there's no disagreement, I'm going to change this in #5763 where I'm standardizing query parsing to follow our JSON pattern (so you can call api.Scheme.Convert(URL.Query.Values(), &api.Object) and version them). That will reduce our number of conversion patterns down to 1, and then we don't need special field naming for these sorts of cases (instead, we are deserializing query parameters into a versional object, then converting it to the internal form).

@derekwaynecarr
Copy link
Member

@smarterclayton +1

@bgrant0607
Copy link
Member

SGTM. Presumably s/label-selector/labelSelector/, also

@brendandburns brendandburns deleted the labels branch August 7, 2015 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants