Repository navigation
Fix | Include kind-level entries in .Capabilities.APIVersions - #501
Conversation
|
@choppedpork This is a good one! Before merging it, I would like us to add an integration test that reproduces this issue. Ideally, we should have two branches to run the tool against and verify that it correctly detects the difference. I know you cannot create branches in this repository, but you could create them in your fork and point the Applications used by the integration tests to your fork instead. 😄 I am a bit limited on time over the next few weeks while preparing for KubeCon US, so I probably will not have much time to set this up myself. I completely understand if creating the branches and configuring the test is a bit cumbersome, though. As an alternative, could you share the External Secrets resources, or an example, that exposed this issue? I could use those as a basis for having my agent create the integration test 🤖 🚀 |
|
Thanks @dag-andersen! I have been using an agent to help me here (and the previous couple of PRs) so it's only fair I've got it to help out on the integration tests too 🙂 What's done:
The two branches in my fork are Have a great KubeCon US - as it happens, it was chatting to you after KubeCon in Amsterdam and finding out about the |
@choppedpork |
Another small one 🙂
With
--render-method=repo-server-api,.Capabilities.APIVersionsonly holds group versions likemonitoring.coreos.com/v1. Argo CD also sends a<groupVersion>/<Kind>entry for every resource, likemonitoring.coreos.com/v1/ServiceMonitor. Both the controller and the API server's manifest endpoint callargo.APIResourcesToStrings(apiResources, true), andincludeKindsadds the kind form, the same on v3.4.3 andmaster. So a chart that gates on a kind renders differently in the diff than in a real sync.We hit this with the external-secrets chart 2.11.0. It gates its ServiceMonitors, metrics Services and the webhook's
metricsport onhas "monitoring.coreos.com/v1/ServiceMonitor" .Capabilities.APIVersions. On a cluster that has the CRD, the diff showed all of them as deleted, even though Argo CD keeps rendering them. A chart that gates on a kind on both sides of a diff is wrong in the same way, just silently.This adds the
<groupVersion>/<Kind>entries next to the group versions, skipping subresources the same way the cluster-scoped lookup already does. There's a test against a fake discovery client. It follows on from #432, which added the group versions.