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

Add namespaced support to objects other than namespaces #40

Merged
merged 1 commit into from
Dec 16, 2016
Merged

Conversation

silasbw
Copy link
Contributor

@silasbw silasbw commented Dec 6, 2016

There are several objects/entities that are namespaced by Kubernetes objects.
/api/v1/namespaces/{namespace}/pods/{name}/log is an obvious one, but there's
more. For example:

  • Proxy objects (e.g., /api/v1/namespaces/{namespace}/services/{name}/proxy/)
  • Deployment related objects (e.g., /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback)
  • ...

This PR implements a story for handling these cases and changes the
documentation to encourage users to use namespaced functionality by default
(e.g., api.ns.po('foo').get(print) vs api.ns.po.get(foo, print)).

@silasbw
Copy link
Contributor Author

silasbw commented Dec 6, 2016

This is in an RFC state and isn't complete (e.g., missing tests). If folks like the API changes and direction I'll finish this off.

@jcrugzz
Copy link
Collaborator

jcrugzz commented Dec 6, 2016

@silasbw I love what you are doing here and that it's so few lines of code. I would add more comments explaining what you are doing in the base class for future contributor understanding and continue along this thread with tests etc.

This will be a breaking change but I'm ok with that.

@silasbw
Copy link
Contributor Author

silasbw commented Dec 6, 2016

@jcrugzz actually, the old way (e.g., api.ns.po.get('foo', print)) still works, it's just not documented.

@bmeck what's the template engine -- are you thinking of the one associated with trimmer?

I'll proceed with this bad larry, add tests, comments, etc. Thanks for the feedback.

@TWood67
Copy link
Contributor

TWood67 commented Dec 6, 2016

@silasbw I think this is a great direction to go. Good stuff!

There are several objects/entities that are namespaced by Kubernetes objects.
`/api/v1/namespaces/{namespace}/pods/{name}/log` is an obvious one, but there's
more. For example:
* Proxy objects (e.g., `/api/v1/namespaces/{namespace}/services/{name}/proxy/`)
* Deployment related objects (e.g., `/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback`)
* ...

This PR implements a story for handling these cases and changes the
documentation to encourage users to use namespaced functionality by default
(e.g., `api.ns.po('foo').get(print)` vs `api.ns.po.get(foo, print)`).
@silasbw
Copy link
Contributor Author

silasbw commented Dec 10, 2016

I took a pass at fleshing this PR out. I think it's ready for a review.

@jcrugzz
Copy link
Collaborator

jcrugzz commented Dec 13, 2016

THis looks good 👍

@silasbw silasbw merged commit d083f93 into master Dec 16, 2016
@silasbw silasbw deleted the named0 branch December 16, 2016 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants