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

Rename Minions -> Nodes internally #2788

Merged
merged 8 commits into from
Dec 10, 2014

Conversation

smarterclayton
Copy link
Contributor

Allows "minions" to be passed to v1beta3, and "nodes" to be passed to v1beta1/v1beta2
endpoints. Relaxes conversion type checking on names where conversion is possible.

Now the API will respond to:

/api/v1beta1/nodes
/api/v1beta2/nodes

identically to their "minions" counterparts. Kubectl and kubecfg will also respect
"nodes".

A few other little fixes in the change. The big one is the mechanical find and replace.

Addresses parts of #1519

@smarterclayton
Copy link
Contributor Author

Brian, wanted your opinion on exposing "nodes" on v1beta1 and v1beta2 as additional endpoints. Right now we allow posting objects of either api version (1 or 2) to any API endpoint, so this is really just allowing naive clients to also post to the old names. Downside is someone writing a new client in another language might not realize that not all v1beta1 servers support "nodes" (joys of additive apis).

@smarterclayton smarterclayton mentioned this pull request Dec 8, 2014
20 tasks
@lavalamp lavalamp assigned lavalamp and unassigned bgrant0607 Dec 8, 2014
@lavalamp
Copy link
Member

lavalamp commented Dec 9, 2014

Everything looks good, I'm just uncomfortable with removing the sanity checks. I added AddKnownTypeWithName in part to allow for type renames; can we make that work for this?

@smarterclayton
Copy link
Contributor Author

Unfortunately the type check happens inside conversion, and the lookup happens after we've already checked the type. Name func might be able to abstract it - I'll look at what options we have. It would require a map of all possible type conversions, or normalization to the same type in both places. Will look at it more - I agree safety is lost this way.

On Dec 8, 2014, at 7:48 PM, Daniel Smith notifications@github.com wrote:

Everything looks good, I'm just uncomfortable with removing the sanity checks. I added AddKnownTypeWithName in part to allow for type renames; can we make that work for this?


Reply to this email directly or view it on GitHub.

@bgrant0607
Copy link
Member

@smarterclayton I'm happier with polluting old API versions (v1beta1/2) to simplify conversion than new ones (v1beta3). Could we not add minions to v1beta3?

@smarterclayton
Copy link
Contributor Author

We can do that - when I expose v1beta3 I'll elide minions from the rest endpoints

On Dec 8, 2014, at 10:47 PM, bgrant0607 notifications@github.com wrote:

@smarterclayton I'm happier with polluting old API versions (v1beta1/2) to simplify conversion than new ones (v1beta3). Could we not add minions to v1beta3?


Reply to this email directly or view it on GitHub.

@smarterclayton smarterclayton force-pushed the roundtrip_node_nodelist branch from 8aa0d37 to 49ef31e Compare December 9, 2014 16:52
@smarterclayton
Copy link
Contributor Author

@lavalamp I reverted the type safety changes, and updated nameFunc to try to find a canonical name for a type by looking at the internal version. If we ever have both "minions" and "nodes" as their own objects (by introducing "minions" as something else in the new api version), we'll need to preserve more information when each type is registered (have an explicit "minions in v1beta1 resolves to nodes internally") but for now we don't need it.

Ready for re-review.

@smarterclayton smarterclayton force-pushed the roundtrip_node_nodelist branch 2 times, most recently from ed943e1 to 84b0fe7 Compare December 9, 2014 18:13
@lavalamp
Copy link
Member

lavalamp commented Dec 9, 2014

LGTM - thanks, that's exactly what I was hoping for.

Is it harmful to leave Minions out of v1beta3 entirely & not just omit them from the REST interface?

@smarterclayton
Copy link
Contributor Author

It helps us test both directions round trip, but it's not strictly useful to end users. We can always drop it from v1 without impact.

----- Original Message -----

LGTM - thanks, that's exactly what I was hoping for.

Is it harmful to leave Minions out of v1beta3 entirely & not just omit them
from the REST interface?


Reply to this email directly or view it on GitHub:
#2788 (comment)

@lavalamp
Copy link
Member

lavalamp commented Dec 9, 2014

LGTM. Kicked travis.

@brendandburns
Copy link
Contributor

looks like it needs a rebase...

Allows v1beta3.Node to be converted to api.Minion
Also refactor v1beta1/conversion_test.go `v1beta` -> `current` to allow
easier cut and paste of tests.
Result is a 500 error if the client object is used
Replaces the client public interface but leaves old references to "minions"
for a later refactor.  Selects the path "nodes" for v1beta3 and "minions"
for older versions.
@smarterclayton smarterclayton force-pushed the roundtrip_node_nodelist branch from 84b0fe7 to 0d887ae Compare December 10, 2014 17:10
@smarterclayton
Copy link
Contributor Author

Rebased, no code changes needed. Waiting for green.

lavalamp added a commit that referenced this pull request Dec 10, 2014
@lavalamp lavalamp merged commit 272bfc9 into kubernetes:master Dec 10, 2014
@smarterclayton
Copy link
Contributor Author

@GoogleCloudPlatform/kubernetes-write FYI Minions are now called Nodes internally, when reviewing code or adding new code we should be gradually phasing out "minion" in doc, functions, variables, etc and replacing it with "node". That may take a long time, but we should suggest it or do it ourselves when we see it.

@davidopp
Copy link
Member

For those of us who are new, what was the reason for the renaming? In my mind "minion" maps to a very specific set of components, whereas when I hear "node" I always wonder is the person talking about what we used to call "minion," or everything that runs in the VM, or everything that runs on the physical machine.

@mbforbes
Copy link
Contributor

Was it perceived political correctness? (I liked "minion" too.)

@bgrant0607
Copy link
Member

#1111

@davidopp
Copy link
Member

Thanks for the pointer to #1111. It looks like the decision was to use "node" in the code and "kubernetes node" or "knode" in documentation and discussion. This seems reasonable, but I hope people actually do use "kubernetes node" or "knode" in documentation and discussion, because "node" is ambiguous for the reasons I mentioned in my previous comment.

@smarterclayton smarterclayton deleted the roundtrip_node_nodelist branch February 11, 2015 02:21
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.

6 participants