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

Flux CLI unable to retrieve image ressource when image CRD is not installed #3973

Closed
1 task done
rchallie opened this issue Jun 13, 2023 · 1 comment · Fixed by #4002
Closed
1 task done

Flux CLI unable to retrieve image ressource when image CRD is not installed #3973

rchallie opened this issue Jun 13, 2023 · 1 comment · Fixed by #4002
Assignees
Labels
bug Something isn't working

Comments

@rchallie
Copy link

Describe the bug

Hi !

When I list all resources of flux using flux get all, got this error message:

✗ 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
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: image.toolkit.fluxcd.io/v1beta1: the server could not find the requested resource

It's seems that it happens when it try to list image ressources but I don't have the CustomRessourceDefinition for image because it's not needed in my cluster.

I tested it in a cluster where I have the CRD and no error is outputed.

Steps to reproduce

  1. With all:
c[_] > flux get all
[...]
✗ 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
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: image.toolkit.fluxcd.io/v1beta1: the server could not find the requested resource
[...]
  1. With image all:
c[_] > flux get all
✗ 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
✗ failed to get API group resources: unable to retrieve the complete list of server APIs: image.toolkit.fluxcd.io/v1beta1: the server could not find the requested resource

Expected behavior

No output.

Screenshots and recordings

No response

OS / Distro

macOS 13.3.1

Flux version

v2.0.0-rc.5

Flux check

► checking prerequisites
✔ Kubernetes 1.27.0 >=1.20.6-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.34.1
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.0.0-rc.4
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.0.0-rc.4
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.0.0-rc.5
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta2
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta2
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rchallie rchallie changed the title Flux CLI unable to retrieve image ressource when CRD for image automation is not installed Flux CLI unable to retrieve image ressource when image CDR is not installed Jun 13, 2023
@stefanprodan
Copy link
Member

I agree that flux get all should not error out, while flux get image all should.

@stefanprodan stefanprodan added the bug Something isn't working label Jun 13, 2023
@makkes makkes self-assigned this Jun 22, 2023
@makkes makkes changed the title Flux CLI unable to retrieve image ressource when image CDR is not installed Flux CLI unable to retrieve image ressource when image CRD is not installed Jun 22, 2023
makkes pushed a commit that referenced this issue 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

Signed-off-by: Max Jonas Werner <mail@makk.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants