gitops-engine
gitops-engine copied to clipboard
Drop dependency on k8s.io/kubernetes
This fixes #56 and helps on the path to addressing https://github.com/argoproj/argo-cd/issues/14727
The go.mod and go.sum changes are from running go mod tidy
.
I misunderstood the initial output and now see that gitops-engine
is using the private conversion functions of k8s.io/kubernetes
. I'm now looking how it is being used since flux does not depend on that.
It looks like the conversion is used in one place in order to avoid a round trip to the Kubernetes API server to perform the conversion. Given that immediately above this section the same API server round trip is done to get the resource and it is only avoided if the cluster cache has a copy of the resource already, it seems to me the conversion functionality imposes more burden on the wider ecosystem than is warranted to maintain.
The other usage is in diff for getting the default values for types. As is, defaulting isn't fully covered by these imports as types continue to evolve and gain new fields and types unknown to the system, e.g. CRDs. We use a few CRDs which make heavy use of field defaulting and they for sure are not known to the gitops-engine, i.e those types from GCP Config Connector. In practice we have not encountered anything impacting our usage of ArgoCD with these types.
Thanks a lot for PR @cehoffman ! Removing conversion will affect PR but probably we can do something about it. E.g. cache converted version as well. Let me please test and see if significantly affects performance
@cehoffman @alexmt is this PR still active? We would benefit from it also - happy to help where I can.
@cehoffman @alexmt is this PR still active? We would benefit from it also - happy to help where I can.
Same here!