kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

kubectl version --error-on-version-mismatch

Open mblaschke-daimlertruck opened this issue 1 year ago • 8 comments
trafficstars

What would you like to be added?

add an flag for kubectl version which fails if the client version exceeds the supported minor version skew of +/-1

--warnings-as-errors isn't working as this only treats warnings as errors when received from the server. the kubectl version warning is a client side warning.

on the other side --match-server-version is too strict.

or add kubectl check-support or something similar

Why is this needed?

avoid running unsupported kubectl versions

mblaschke-daimlertruck avatar Sep 06 '24 12:09 mblaschke-daimlertruck

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 06 '24 12:09 k8s-ci-robot

/sig cli

neolit123 avatar Sep 06 '24 13:09 neolit123

Doesn't this exist https://github.com/kubernetes/kubernetes/blob/32077a1c008a59d797e4f4ae8717a0dbbe3c3db7/staging/src/k8s.io/kubectl/pkg/cmd/version/version.go#L164-L167 prints warning if https://github.com/kubernetes/kubernetes/blob/32077a1c008a59d797e4f4ae8717a0dbbe3c3db7/staging/src/k8s.io/kubectl/pkg/cmd/version/skew_warning.go#L34-L54 detects skew?

ardaguclu avatar Sep 06 '24 13:09 ardaguclu

Is the ask that there should be an option for kubectl to return an error instead of warning if the skew is greater than 1?

Jefftree avatar Sep 06 '24 17:09 Jefftree

Is the ask that there should be an option for kubectl to return an error instead of warning if the skew is greater than 1?

Yes, that is correct. I missed that part.

/transfer kubectl

ardaguclu avatar Sep 09 '24 04:09 ardaguclu

/triage accepted /good-first-issue It seems like there were a few plugins to address this in the past that have gone missing.

mpuckett159 avatar Sep 11 '24 16:09 mpuckett159

@mpuckett159: This request has been marked as suitable for new contributors.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to this:

/triage accepted /good-first-issue It seems like there were a few plugins to address this in the past that have gone missing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Sep 11 '24 16:09 k8s-ci-robot

/assign

omerap12 avatar Sep 12 '24 14:09 omerap12

/assign

pabhi18 avatar Apr 15 '25 18:04 pabhi18