Skip to content

Conversation

ardaguclu
Copy link
Member

@ardaguclu ardaguclu commented Sep 26, 2025

  • Other comments:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 26, 2025
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/cli Categorizes an issue or PR as relevant to SIG CLI. labels Sep 26, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG CLI Sep 26, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 26, 2025
@ardaguclu
Copy link
Member Author

/hold
for PRR review

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2025
@ardaguclu
Copy link
Member Author

for sig-cli
/cc @soltysh
for PRR
/cc @johnbelamaric

@ardaguclu ardaguclu force-pushed the kubectl-kuberc branch 3 times, most recently from 2693462 to c8f4645 Compare September 26, 2025 09:39
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
Copy link
Contributor

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.

Copy link
Contributor

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 😅

Copy link
Member Author

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?

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member Author

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?.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable.

@soltysh soltysh moved this from Needs Triage to In Progress in SIG CLI Oct 3, 2025
@soltysh soltysh removed the request for review from johnbelamaric October 3, 2025 10:03
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2025
Copy link
Contributor

@soltysh soltysh left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`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
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`--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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`--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.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2025
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@soltysh
Copy link
Contributor

soltysh commented Oct 7, 2025

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 7, 2025
@soltysh
Copy link
Contributor

soltysh commented Oct 7, 2025

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit bed6973 into kubernetes:master Oct 7, 2025
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.35 milestone Oct 7, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in SIG CLI Oct 7, 2025
@ardaguclu ardaguclu deleted the kubectl-kuberc branch October 7, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants