-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 support for applying set of resources via kubectl #1958
Conversation
@smarterclayton fyi This is a quick and dirty extraction from the origin repo where I removed references to our objects. Not sure if the Label update should be part of this or we can strip it down as well. |
Sorry, this was supposed to be on kubectl as a new submit command, not on kubecfg. Kubecfg is going away |
Take the label update out - this is about taking a set of files or a config or multiple configs directly as they are. Brian's comments on the other pull made a good case against addingn labels. If necessary we will move that back to templates |
@smarterclayton OK, how about |
abstract the mechanism to get the mappings for a given Kind into a method, only implement the Kube objects in that method, and then leave a TODO to sort out client extensibility. |
@smarterclayton ack, will look into this tomorrow. |
|
||
// Config contains a set of Kubernetes resources to be applied. | ||
// TODO: Unify with Kubernetes Config | ||
// https://github.com/GoogleCloudPlatform/kubernetes/pull/1007 |
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.
Remove this TODO
@smarterclayton Which comments do you mean? |
/cc @ghodss |
package v1beta1 | ||
|
||
import ( | ||
kubeapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1" |
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.
If we decide to keep this definition, we should spec a v1beta3 version, also.
Very cool! Thanks much. |
As per #1744 we may want to keep them separate and then import them into v1beta1/2/3/internal placeholders. Also, Config is not a server side type yet, even though it is an API type. ----- Original Message -----
|
@smarterclayton I updated the Config registration (moved it into api/*/types.go) and removed labels, etc. Can you please review those changes? The kubectl is still pending, I will try to have some PoC this weekend. |
{ | ||
"id": "frontend", | ||
"kind": "Service", | ||
"apiVersion": "v1beta3", |
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.
FYI, these aren't using the v1beta3 schema. It looks like v1beta1.
10e2ed7
to
6095e56
Compare
// be valid API type. It requires ObjectTyper to parse the Version and Kind and | ||
// RESTMapper to get the resource URI and REST client that knows how to create | ||
// given type | ||
func ApplyItems(typer runtime.ObjectTyper, mapper meta.RESTMapper, clientFor ClientFunc, items []runtime.Object) errs.ValidationErrorList { |
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.
This just does Create. Please rename to CreateItems.
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.
+1
How about CreateObjects
?
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.
CreateObjects also SGTM, especially if "items" no longer exists in the serialization.
@bgrant0607 @smarterclayton PR rebased and updated. Thanks! |
bd47135
to
568173f
Compare
@smarterclayton @bgrant0607 I'm thinking about removing the |
LGTM. Thanks! config_test.json is useful, I think, because it illustrates the format expected by createall. |
Regarding docs: we eventually need a new version of cli.md, but right now we don't have any doc for kubectl AFAIK. |
Add support for applying set of resources via kubectl
Some next steps I'd like to see - @bgrant0607 your opinion?
|
@smarterclayton SGTM. In addition to update and get, I'd like to be able to drive delete from an Object stream. Could you copy your last comment over to #1905? |
Move KEP-5 to implementable
[release-4.14] OCPBUGS-14373: Fix flaky HPA e2e tests by not failing on context cancelled (kubernetes#117669)
Discussion: #1905