Skip to content
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

Replace fmt.Print with printer in upgrade plan code and fix configVersions are not printed when output is json or yaml #123492

Merged
merged 1 commit into from Feb 25, 2024

Conversation

carlory
Copy link
Member

@carlory carlory commented Feb 25, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

root@kind-control-plane:/# kubeadm upgrade plan -ojson
[upgrade] Running cluster health checks
I0223 06:41:31.158831    1526 version.go:256] remote version is much newer: v1.29.2; falling back to: stable-1.28
{
    "kind": "UpgradePlan",
    "apiVersion": "output.kubeadm.k8s.io/v1alpha2",
    "components": [
        {
            "name": "kubelet",
            "currentVersion": "1 x v1.28.0",
            "newVersion": "v1.28.7"
        },
        {
            "name": "kube-apiserver",
            "currentVersion": "v1.28.0",
            "newVersion": "v1.28.7"
        },
        {
            "name": "kube-controller-manager",
            "currentVersion": "v1.28.0",
            "newVersion": "v1.28.7"
        },
        {
            "name": "kube-scheduler",
            "currentVersion": "v1.28.0",
            "newVersion": "v1.28.7"
        },
        {
            "name": "kube-proxy",
            "currentVersion": "v1.28.0",
            "newVersion": "v1.28.7"
        },
        {
            "name": "CoreDNS",
            "currentVersion": "v1.10.1",
            "newVersion": "v1.10.1"
        },
        {
            "name": "etcd",
            "currentVersion": "3.5.9-0",
            "newVersion": "3.5.9-0"
        }
    ],
    "configVersions": null
}
root@kind-control-plane:/# kubeadm upgrade plan -ojson | jq .
parse error: Invalid numeric literal at line 1, column 9
^C

Which issue(s) this PR fixes:

Ref kubernetes/kubeadm#494

Special notes for your reviewer:

Does this PR introduce a user-facing change?

kubeadm: fix a bug where "kubeadm upgrade plan -o yaml|json" includes unneeded output and was missing component config information.

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. 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. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 25, 2024
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

CI errors need to be fixed, but LGTM
works locally too.

/triage accepted
/priority backlog
/approve

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed 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 Feb 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlory, neolit123

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 Feb 25, 2024
@neolit123
Copy link
Member

/release-note-edit

kubeadm: fix a bug where "kubeadm upgrade plan -o yaml|json" includes unneeded output and was missing component config information.

@neolit123
Copy link
Member

neolit123 commented Feb 25, 2024

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

you can remove the text in the box under, it's not needed for this PR.

…sions are not printed when output is json or yaml
@carlory
Copy link
Member Author

carlory commented Feb 25, 2024

/cc @pacoxu

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm
to unblock #123461

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

LGTM label has been added.

Git tree hash: df44b4e56f0b210b670773e9556ffdb677dbd5fd

@k8s-ci-robot k8s-ci-robot merged commit a58221c into kubernetes:master Feb 25, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Feb 25, 2024
@sftim
Copy link
Contributor

sftim commented Mar 12, 2024

Changelog suggestion

-kubeadm: fix a bug where "kubeadm upgrade plan -o yaml|json" includes unneeded output and was missing component config information.
+kubeadm: fixed a bug where `kubeadm upgrade plan -o yaml|json` included unneeded output,
+and was missing component config information.

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants