Drop dependency on k8s.io/kubernetes #535
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #56 and helps on the path to addressing argoproj/argo-cd#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 ofk8s.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.