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

Do not wrap lines if we can't read term size #109722

Merged
merged 1 commit into from Apr 29, 2022

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented Apr 29, 2022

What type of PR is this?

/kind bug
/kind regression
/sig cli

What this PR does / why we need it:

In #104736 we introduced pretty printed help messages for kubectl.
Unfortunately, in some scripts it's possible that this will return the following error:

Error: template: usage:12:43: executing "usage" at <flagsUsages $visibleFlags>: error calling flagsUsages: file descriptor is not a terminal

I've noticed that while changing introducing this change into OpenShift (openshift/oc#1121, specifically failures from https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_oc/1121/pull-ci-openshift-oc-master-e2e-agnostic-cmd/1519729283440840704). This PR make it so that when we can't read the term size, we just set the limit to 0 which make the wrapping not to happen at all, which is consistent with previous mechanism.

Special notes for your reviewer:

/assign @ardaguclu @eddiezane
/cc @lauchokyip

Does this PR introduce a user-facing change?

Fix 1.24 regression in kubectl help output

@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.24 branch. This means every merged PR has to be cherry-picked into the release branch to be part of the upcoming v1.24.0 release.

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Apr 29, 2022
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. labels Apr 29, 2022
@k8s-ci-robot k8s-ci-robot added kind/regression Categorizes issue or PR as related to a regression from a prior release. sig/cli Categorizes an issue or PR as relevant to SIG CLI. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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 Apr 29, 2022
@soltysh
Copy link
Contributor Author

soltysh commented Apr 29, 2022

/milestone v1.24
I'll open a cherry-pick as soon as this merges, to ensure we don't break users.

@k8s-ci-robot k8s-ci-robot added area/kubectl approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 29, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Apr 29, 2022
@soltysh
Copy link
Contributor Author

soltysh commented Apr 29, 2022

/triage accepted
/priority important-longterm

@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. 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 Apr 29, 2022
@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 Apr 29, 2022
Copy link
Member

@brianpursley brianpursley left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

soltysh commented Apr 29, 2022

/test pull-kubernetes-e2e-kind

@k8s-ci-robot k8s-ci-robot merged commit e7a2ce7 into kubernetes:master Apr 29, 2022
@k8s-ci-robot k8s-ci-robot modified the milestones: v1.24, v1.25 Apr 29, 2022
@soltysh soltysh deleted the fix_templater branch April 29, 2022 14:44
k8s-ci-robot added a commit that referenced this pull request May 20, 2022
…722-upstream-release-1.24

Automated cherry pick of #109722: Do not wrap lines if we can't read term size
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 9, 2023
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/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. 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/cli Categorizes an issue or PR as relevant to SIG CLI. size/XS Denotes a PR that changes 0-9 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

5 participants