-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
kubeadm: turn api into a real apigroup #34147
Conversation
78e4761
to
2052a01
Compare
Jenkins verification failed for commit 2052a01. Full PR test history. The magic incantation to run this job again is |
+1 on the idea @mikedanese (sadly I don't know enough to review the code). And thanks for providing an example on how to use the k8s api machinery. (Did you find a nice doc on how to do this BTW?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the code change, but are we sure we want to use the API machinery for what is essentially a versioned config file? cc @kubernetes/sig-api-machinery
Things I usually associate with an API group that don't apply here:
- Swagger definitions
- API discovery
- Storage interfaces
- Client
- REST endpoints
- alternate encodings
If we do use the API, would this work without ugorji codec?
func ValidateNodeConfiguration(o *MasterConfiguration) error { | ||
return nil | ||
} | ||
// +groupName=kubeadm.k8s.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does our machinery require that this line come right before the package statement? Comments, even annotations like this, right before package statements show up as documentation on godoc.org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. We need to fix it
@@ -0,0 +1,38 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make the path to this file (and other api machinery files) be .../apis/<your group name>/...
, not /api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does registering an API group provide? I only need versioning, defaulting and documentation.
announced.VersionToSchemeFunc{ | ||
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme, | ||
}, | ||
).Announce().RegisterAndEnable(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually need to register this group?
Yes, good question, I wonder about this also. |
@mikedanese thanks a lot for doing this! As far as I understand, this is not in use yet, so are you planning to make use of it in a follow-up PR or you will add it here? |
End goal is to make this deserialize the internal config representation from a file passed in from the command line for the "configurable mode" experience. With this we can hopefully avoid diluting the streamlined command line experience. |
I feel like this ship flew with componentconfig. Aren't these requirements (versioning, defaulting and documentation) the some of the core use cases for API groups? |
It will make it an option in the --runtime-config flag, which I guess On Thu, Oct 6, 2016 at 11:48 PM, Mike Danese notifications@github.com
|
2052a01
to
80116c7
Compare
80116c7
to
b3dae78
Compare
Ok unregistered the group. |
What about roundtrip testing? |
I think previous commit 56ea178 may have broken something, the controller manager is unable to start up with a plain "kubeadm init master" now:
|
@dgoodwin before in |
@mikedanese @dgoodwin |
@krousey is that an lgtm? :) |
@errordeveloper Yes, that was probably a rebase conflict or something from some previous refactoring PR (after our "stable" v1.4 release) @mikedanese I think that's a LGTM, yes @errordeveloper Any comments on this one? |
Yes, I'm familiar with the goal already 👍 :) I am just wondering how far does this change set get us, I cannot see any flags being added here explicitly, I'd expect there to be at least one more change set to plumb it through, yet I am not aware if there is any magic that would infer any automatic flags for passing a componentconfig file in... |
Yes On Oct 10, 2016 08:28, "Mike Danese" notifications@github.com wrote:
|
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
@kubernetes/sig-cluster-lifecycle
This change is