-
Notifications
You must be signed in to change notification settings - Fork 153
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
gitops check failing after kubectl --short flag deprecation #4157
Labels
bug
Something isn't working
Comments
@makkes wanna take a look? :-) |
I'm on it. |
makkes
pushed a commit
that referenced
this issue
Dec 6, 2023
The `--short` flag has been removed from `kubectl version` in 1.28 (https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/CHANGELOG/CHANGELOG-1.28.md#L1718) so the command obviously fails now. This commit changes the behaviour of the `gitops check` command to create a client-go DiscoveryClient and use that to retrieve the server version. That way we don't have to rely on forking a `kubectl` process and the output being consistent. The code is now much cleaner, easier to read and properly tested. closes #4157 Signed-off-by: Max Jonas Werner <mail@makk.es>
Merged
makkes
pushed a commit
that referenced
this issue
Dec 6, 2023
The `--short` flag has been removed from `kubectl version` in 1.28 (https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/CHANGELOG/CHANGELOG-1.28.md#L1718) so the command obviously fails now. This commit changes the behaviour of the `gitops check` command to create a client-go DiscoveryClient and use that to retrieve the server version. That way we don't have to rely on forking a `kubectl` process and the output being consistent. The code is now much cleaner, easier to read and properly tested. closes #4157 Signed-off-by: Max Jonas Werner <mail@makk.es>
makkes
pushed a commit
that referenced
this issue
Dec 6, 2023
The `--short` flag has been removed from `kubectl version` in 1.28 (https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/CHANGELOG/CHANGELOG-1.28.md#L1718) so the command obviously fails now. This commit changes the behaviour of the `gitops check` command to create a client-go DiscoveryClient and use that to retrieve the server version. That way we don't have to rely on forking a `kubectl` process and the output being consistent. The code is now much cleaner, easier to read and properly tested. closes #4157 Signed-off-by: Max Jonas Werner <mail@makk.es>
makkes
pushed a commit
that referenced
this issue
Dec 6, 2023
The `--short` flag has been removed from `kubectl version` in 1.28 (https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/CHANGELOG/CHANGELOG-1.28.md#L1718) so the command obviously fails now. This commit changes the behaviour of the `gitops check` command to create a client-go DiscoveryClient and use that to retrieve the server version. That way we don't have to rely on forking a `kubectl` process and the output being consistent. The code is now much cleaner, easier to read and properly tested. closes #4157 Signed-off-by: Max Jonas Werner <mail@makk.es>
bigkevmcd
pushed a commit
that referenced
this issue
Dec 6, 2023
* Fix `gitops check` The `--short` flag has been removed from `kubectl version` in 1.28 (https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/CHANGELOG/CHANGELOG-1.28.md#L1718) so the command obviously fails now. This commit changes the behaviour of the `gitops check` command to create a client-go DiscoveryClient and use that to retrieve the server version. That way we don't have to rely on forking a `kubectl` process and the output being consistent. The code is now much cleaner, easier to read and properly tested. closes #4157 * Bump supported K8s version The support policy of Weave GitOps is to "test Weave GitOps against the latest supported Kubernetes releases" which means that only 1.26, 1.27 and 1.28 are supported at this point. This change doesn't prevent Weave GitOps from being run on older versions of Kubernetes as the constraint is only used by the `gitops check` command which is purely informational. Signed-off-by: Max Jonas Werner <mail@makk.es>
@mjtrangoni this should be fixed in the 0.38.0 CLI which we released today. Mind giving it a try? |
@makkes thank you! It works now, see gitops version
Current Version: 0.38.0
GitCommit: 693dafd494f1027c4bc740be9ffef98e21cdcfb6
BuildTime: 2023-12-06T15:43:30Z
Branch: releases/v0.38.0
gitops check
✔ Kubernetes 1.28.4+k3s1 >=1.26 Not related with this issue but I just wonder, the command says, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Running
gitops check
return exit status 1 instead of skipping/handling the error.Environment
To Reproduce
Steps to reproduce the behavior:
gitops check
gitops check Error: unable to get kubernetes version: exit status 1
Expected behavior
To run without errors, maybe checking kubectl version compatibility?
Actual Behavior
gitops check Error: unable to get kubernetes version: exit status 1
Additional Context (screenshots, logs, etc)
It seems this is related to kubectl
--short
flag used in this project, see here.As it says in kubectl's CHANGELOG.md,
--short
is deprecated and changedkubectl version
default output to be identical to whatkubectl version --short
printedThe text was updated successfully, but these errors were encountered: