-
Notifications
You must be signed in to change notification settings - Fork 159
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
The YAML tab displays a wrong version of CRD #3626
Comments
I'm talking to Kevin and probably Simon to investigate this. |
Found a feasible solution. I'll go fix it this way first. |
|
@bigkevmcd noted we could check out kubectl does it |
The finding by @yitsushi #3811 (comment) |
Ultimately, it depends on what you think you're showing, if you think you're showing the version in the cluster that's different from the version that might be in git. Things like storage versions and conversion webhooks make what's in git somewhat irrelevant, git is surprisingly, not the source of truth for this. |
@chanwit is there anything that we think we would do around this ticket? |
I think we could close this issue for now, as the issue would be fixed already by our Flux v2 upgrade. If the problem still persists, we can reopen this issue. |
Based on our findings yesterday, it seems that we should revisit this logic for the https://github.com/weaveworks/weave-gitops/blob/main/core/server/primarykinds.go#L126 Scenario #1 - both gvk exists
Scenario #2 - only v1 exists
We have also seen Scenario #3 - only beta exits |
bumping the severity as from v0.29 we want to manage v1 resources over beta |
Yes @LappleApple i take over |
Problem
According to this:
weave-gitops/core/server/primarykinds.go
Lines 21 to 34 in 5cd78d7
The DefaultPrimaryKinds() function in the provided code snippet is designed to loop over all known types in the Kubernetes scheme and create a map of GroupVersionKinds (GVKs). However, there is a hidden bug in this function, which makes it unable to obtain the storage version from the scheme.
The issue arises because the function relies on the scheme.AllKnownTypes() map, which contains types registered in the program during compile time. If the program uses a different version of an object (e.g., v1beta2 version of GitRepository) than the environment it's running in (e.g., an environment with the v1 version of GitRepository), the program does not have the knowledge of the environment's version (in this example, GitRepository/v1). This is because the environment's version only exists in the actual cluster, not in the program's registered types.
As a result of this bug, the YAML tab might display incorrect versions of objects, leading to potential issues and inconsistencies when working with Kubernetes objects.
Proposed solution
To address the bug, the first approach would be to update the program to have matching versions of objects registered, ensuring consistency between the program and the environment it's running in. By doing this, the program will have knowledge of the correct versions and can display accurate information in the YAML tab.
If upgrading the program to have matched versions registered does not resolve the issue effectively, a follow-up ticket will be created to further investigate the problem and find an alternative solution. This ensures that the bug is addressed and the correct versions of objects are displayed, improving the overall user experience and preventing potential issues when working with Kubernetes objects.
The text was updated successfully, but these errors were encountered: