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

fix: --short arg in kubectl cmd does not exist in later versions #1429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Banh-Canh
Copy link

Description

kubectl version --short is now the default since >=1.28, and the arg has been removed.

Screenshot

Please see: kubernetes/kubernetes#122455 (comment)

Copy link

netlify bot commented Apr 14, 2024

Deploy Preview for spaceship-prompt ready!

Name Link
🔨 Latest commit a30513a
🔍 Latest deploy log https://app.netlify.com/sites/spaceship-prompt/deploys/661bab46741c7e0008947bda
😎 Deploy Preview https://deploy-preview-1429--spaceship-prompt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -31,7 +31,7 @@ spaceship_kubectl_version() {
[[ -z $kube_context ]] && return

# if kubectl can't connect kubernetes cluster, kubernetes version section will be not shown
local kubectl_version=$(kubectl version --short 2>/dev/null | grep "Server Version" | sed 's/Server Version: \(.*\)/\1/')
local kubectl_version=$(kubectl version>/dev/null | grep "Server Version" | sed 's/Server Version: \(.*\)/\1/')
Copy link
Member

Choose a reason for hiding this comment

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

Does this work?
>/dev/null seems to be hushing everything, not just errors.

Copy link
Author

Choose a reason for hiding this comment

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

It does work, on the newer version >1.28 though. Didn't test on lower ones.

The --short args is not required and actually removed hence why it broke on newer version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants