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

Don't log errors with missing CRDs for "get * all" commands #4002

Merged
merged 1 commit into from Jun 22, 2023
Merged

Conversation

makkes
Copy link
Member

@makkes makkes commented Jun 22, 2023

Whenever an API type is not available then both, flux get all and flux get image all will just skip over that type instead of logging an error message.

Before:

$ flux get all
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: source.toolkit.fluxcd.io/v1beta2: the server could not find the requested resource
[...]
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could not find the requested resource
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could not find the requested resource
[...]
$ echo $?
0

After:

$ flux get all
$ echo $?
0

closes #3973

Whenever an API type is not available then both, `flux get all` and
`flux get image all` will just skip over that type instead of logging
an error message.

Before:

```
$ flux get all
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: source.toolkit.fluxcd.io/v1beta2: the server
could not find the requested resource
[...]
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
[...]
$ echo $?
0
```

After:

```
$ flux get all
$ echo $?
0
```
closes #3973

Signed-off-by: Max Jonas Werner <mail@makk.es>
@makkes makkes requested a review from stefanprodan June 22, 2023 16:04
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @makkes 🏅

@makkes makkes merged commit cf5e7c3 into main Jun 22, 2023
8 checks passed
@makkes makkes deleted the fix-get-all branch June 22, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flux CLI unable to retrieve image ressource when image CRD is not installed
2 participants