-
Notifications
You must be signed in to change notification settings - Fork 1.6k
KEP-3104: Add kubectl kuberc command section #5572
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
Conversation
/hold |
for sig-cli |
2693462
to
c8f4645
Compare
By default, this command errors out, if it finds a section of same command and same flag that is executed. `--overwrite` flag | ||
is used to update this section. | ||
|
||
#### recommended |
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'd imagine that recommended options would be added on the first invocation, w/o any flag. Iow. I'm running kubectl kuberc
(any of the sub-commands for the very first time. The user is presented with a question that there is not kuberc
present and should we create one. Example flow below:
$ kubectl kuberc view
It seems you don't have a kuberc file, yet. Shall I create one with recommended options (Y/n): y
Default kuberc created in /home/maciej/.kube/kuberc
Similarly if user says No, we don't do anything.
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.
In other words, drop this flag entirely 😅
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 makes sense. I dropped the flag definition from the KEP. We can discuss the interactive behavior of recommended in the PR?
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.
Yeah, it doesn't have to be described in detail in this document.
|
||
`kubectl kuberc view` subcommand prints the defined kuberc file content in the given format via `--output` flag (default is yaml). | ||
|
||
### kubectl kuberc default |
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 wonder if we should replace kubectl kuberc default|alias
with a more generic mechanism. #5479 adds a new section to kuberc
, does that mean we should be adding more sub-commands for every section? I'm fully aware that not all sections will be supported, but at the same time I want to avoid the proliferation of sub-commands, just like we have currently under kubectl config
.
What do you think about doing:
kubectl kuberc set --section defaults --command=apply --option=server-side=true
kubectl kuberc set --section aliases server-apply --command=apply --option=server-side=true
I'm aware that even with this approach we'll be required to expand the support for every section manually. Wdyt?
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 think, this is reasonable with one caveat;
kubectl kuberc set --section aliases server-apply --command=apply --option=server-side=true
we need to extract the alias name server-apply
from here. Cobra may not give this us easily (because alias name comes after the --section
flag definition), so I proposed a --name
flag for the easier mapping something like this;
kubectl kuberc set --section aliases --name server-apply --command=apply --option=server-side=true
WDYT?.
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.
That sounds reasonable.
10a520d
to
6ad4692
Compare
6ad4692
to
8e80963
Compare
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.
Minor nits, we can update once we'll be updating this next time.
/lgtm
/approve
|
||
### kubectl kuberc set --section defaults | ||
|
||
`kubectl kuberc set --section defaults` subcommand creates/updates the default values of commands. It has the following flags; |
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.
`kubectl kuberc set --section defaults` subcommand creates/updates the default values of commands. It has the following flags; | |
`kubectl kuberc set --section defaults` subcommand creates/updates the default values of commands. It has the following flags: |
By default, this command errors out, if it finds a section of same command and same flag that is executed. `--overwrite` flag | ||
is used to update this section. | ||
|
||
#### recommended |
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.
Yeah, it doesn't have to be described in detail in this document.
|
||
`kubectl kuberc view` subcommand prints the defined kuberc file content in the given format via `--output` flag (default is yaml). | ||
|
||
### kubectl kuberc default |
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.
That sounds reasonable.
|
||
#### appendarg | ||
|
||
`--appendarg` is an arbitrary list of strings that accepts anything in string array format. |
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.
`--appendarg` is an arbitrary list of strings that accepts anything in string array format. | |
`--appendarg` is an arbitrary list of strings that accept anything in string array format. |
|
||
#### prependarg | ||
|
||
`--prependarg` is an arbitrary list of strings that accepts anything in a string array format. |
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.
`--prependarg` is an arbitrary list of strings that accepts anything in a string array format. | |
`--prependarg` is an arbitrary list of strings that accept anything in a string array format. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
/label tide/merge-method-squash |
One-line PR description: Add
kubectl kuberc
command to generate kuberc files.Issue link: