Skip to content

Deprecate kubeconfig's preference field in favor of kuberc #131741

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

Merged
merged 1 commit into from
May 20, 2025

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented May 13, 2025

What type of PR is this?

/kind cleanup
/kind documentation
/kind feature
/kind api-change
/kind deprecation

What this PR does / why we need it:

While updating the kuberc KEP I've noticed we explicitly said we'll deprecate the kubeconfig's preferences field.

Which issue(s) this PR fixes:

Ref: kubernetes/enhancements#3104

Special notes for your reviewer:

/assign @ardaguclu
for sig-cli changes

/assign @liggitt
for api-review

Does this PR introduce a user-facing change?

Deprecate preferences field in kubeconfig in favor of kuberc

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/issues/3104

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 13, 2025
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels May 13, 2025
@k8s-ci-robot k8s-ci-robot requested review from skitt and sttts May 13, 2025 11:41
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 13, 2025
@soltysh
Copy link
Contributor Author

soltysh commented May 13, 2025

/triage accepted
/priority important-longterm
/label api-review

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. api-review Categorizes an issue or PR as actively needing an API review. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 13, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 13, 2025
@soltysh
Copy link
Contributor Author

soltysh commented May 13, 2025

@liggitt a question for this deprecation, given this field is not used internally by any part of kubernetes codebase, can we consider entirely dropping it or we'll have to keep it deprecated?

@@ -51,6 +52,7 @@ type Config struct {
Extensions []NamedExtension `json:"extensions,omitempty"`
}

// Deprecated in v1.34 in favor of kuberc file (see https://kep.k8s.io/3104).
type Preferences struct {
// +optional
Colors bool `json:"colors,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

do we not even honor this field in kubectl? 🤦

looks like the only spot we use color is in the warning writer, and that just goes off of terminal autodetection and the NO_COLOR envvar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do we not even honor this field in kubectl? 🤦

Nope, it's just not used 😞

@liggitt
Copy link
Member

liggitt commented May 13, 2025

@liggitt a question for this deprecation, given this field is not used internally by any part of kubernetes codebase, can we consider entirely dropping it or we'll have to keep it deprecated?

umm... we don't know what else is plumbing / persisting data in the extensions field, and given we named it extensions, it sort of invites opaque plumbing by out-of-tree stuff, so I think we should just keep it marked deprecated

@liggitt liggitt moved this to In progress in API Reviews May 14, 2025
@@ -37,6 +37,7 @@ type Config struct {
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions
// Deprecated in v1.34 in favor of kuberc file (see https://kep.k8s.io/3104).
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure referencing kuberc here makes sense... nothing under this struct has any relationship with anything in kuberc, right?

Just adding a deprecation comment, indicating no Kubernetes components make use of this field, and adding omitzero to clean up preferences: {} noise might be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure referencing kuberc here makes sense... nothing under this struct has any relationship with anything in kuberc, right?

Just adding a deprecation comment, indicating no Kubernetes components make use of this field, and adding omitzero to clean up preferences: {} noise might be nice

Updated deprecation message and added omitzero. Should be good for re-review.

@liggitt liggitt removed the status in API Reviews May 14, 2025
@liggitt liggitt moved this to Changes requested in API Reviews May 14, 2025
@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels May 20, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG CLI May 20, 2025
@soltysh soltysh force-pushed the deprecate_preferences branch from 0016ea9 to bb92b61 Compare May 20, 2025 11:23
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels May 20, 2025
@liggitt
Copy link
Member

liggitt commented May 20, 2025

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 3edf93325ce38f6710f8558417218ae1e6f48c86

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2025
@soltysh soltysh force-pushed the deprecate_preferences branch from bb92b61 to 8cf5e8d Compare May 20, 2025 11:32
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2025
@ardaguclu
Copy link
Member

/lgtm

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

LGTM label has been added.

Git tree hash: 55922b69c376a3765be6d5be3a64f0d2dc4b10b8

@skitt
Copy link
Member

skitt commented May 20, 2025

/lgtm

@soltysh
Copy link
Contributor Author

soltysh commented May 20, 2025

Flake #131834
/test pull-kubernetes-e2e-gce

@k8s-ci-robot k8s-ci-robot merged commit c40db09 into kubernetes:master May 20, 2025
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.34 milestone May 20, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in SIG CLI May 20, 2025
@soltysh soltysh deleted the deprecate_preferences branch May 20, 2025 15:12
@@ -607,7 +607,6 @@ clusters:
contexts: null
current-context: ""
kind: Config
preferences: {}
Copy link
Member

Choose a reason for hiding this comment

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

this broke one of kubeadm's e2e tests for dryrun which under the hood utilizes a fake client with reactors and fixtures. more particularly it dryruns the bootstrap token and cluster-info configmap validation.

we must also update line 614 with the expected JWS signature after the contents of the cluster-info have changed.

fix is pending, looking for lgtm:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, didn't catch that bit anywhere.

@liggitt liggitt moved this from Changes requested to API review completed, 1.34 in API Reviews May 22, 2025
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. area/kubeadm area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.34
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants