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 cannot find the requested resource (patch) #4917

Open
1 task done
AndreiBarbuOz opened this issue Aug 7, 2024 · 0 comments
Open
1 task done

Flux cannot find the requested resource (patch) #4917

AndreiBarbuOz opened this issue Aug 7, 2024 · 0 comments

Comments

@AndreiBarbuOz
Copy link

AndreiBarbuOz commented Aug 7, 2024

Describe the bug

Flux seems to cache the content of the Discovery endpoint, without any mechanism to invalidate. When CRDs are updated in a way in which new paths need to be used, the controller doesn't have a way of recovering without being recycled

Steps to reproduce

Install CRD
Restart Flux pod
Update CRD in a way in which the .spec.names.plural is updated
Use a Kustomization object to create a CR of the GVK defined in the CRD

Expected behavior

Expect Flux, after initial failure to create the object

103s        Warning   ReconciliationFailed         kustomization/bar-resources   FooKind/ns/object-foo not found: the server could not find the requested resource (patch plural.group object-foo)

to invalidate the cache and pull the API resources available on the server without having to delete the pod

Screenshots and recordings

No response

OS / Distro

N/A

Flux version

no client used, deployed via helm

Flux check

helm list -A
NAME                            NAMESPACE                       REVISION        UPDATED                                 STATUS          CHART                                                                           APP VERSION
flux2                           flux-system                     84              2024-08-03 00:46:23.703866088 +0000 UTC deployed        flux2-2.13.0                                                                    2.3.0

Git provider

No response

Container Registry provider

No response

Additional context

Change in plural is sometimes triggered by code generators using different libraries:
https://github.com/gobuffalo/flect/blob/6ae77794e62b2755d42b9dbdf27ec7f69ac5a864/pluralize.go#L67-L70
vs:
https://github.com/kubernetes/gengo/blob/f967bbeff4b4bb4d9d4c7e33a03c522632bdf4f8/namer/plural_namer.go#L105

but, by the time this is propagated, the Flux pod seems to have already cached the CRDs

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

No branches or pull requests

1 participant