-
Notifications
You must be signed in to change notification settings - Fork 260
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
Drop k8s.io/kubernetes dependency #56
Comments
One option would be to copy the bits that are not available in other packages. I'm willing to do the work if maintainers are ok with that. Please let me know. |
Hm, I have just discovered that I cannot use the engine because of this dependency. I'm getting the following error when building my project with bazel:
This is because https://github.com/kubernetes/kubernetes/blob/07d88617e55b64c243956c7b2032430beb03b159/pkg/kubectl/cmd/auth/BUILD#L16 prohibits to import this package. This is not a problem if Go modules are used, but the package cannot be used via bazel+gazelle (my case). Clearly package authors do not want anyone to depend on it. |
I've tried copying the code but ran into these issues:
So I guess I have to look for a workaround... p.s. I think conversion functions might not be safe to use on the client side. An example: gitops-engine imports kubernetes version |
Same requirement will be for https://github.com/argoproj/argo-cd, but this needs to be fixed first (as gitops-engine is a dependency of argo-cd) |
I'm just curious what makes the dependency on kubernetes unwieldy exactly? |
go module system - replace directive, used in argocd Plus, using |
ok, ya, I just ran into this:
|
this one is hairy: gitops-engine/pkg/utils/kube/ctl.go Line 29 in 4bd4f29
lots to copy as this pulls in
which pulls in:
|
Some good progress kubernetes/kubernetes#96145 |
Some more good news: https://docs.google.com/document/d/121FWis7sIzdG83H9T8G2qvSB6inxJoUub5KsVwFDa60/edit#heading=h.mipaetrdowr and https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/2144-clientgo-apply#apply-functions So after #205 merges our only blocker for dropping k/k dependency is the defaulting that we are using from scheme - see #206. Once client-go receives Server Side Apply support, my understanding is that it'll be possible to use this new API to issue a dry-run apply command to receive the new object. Then it should be possible to perform a diff between current in-cluster object and the returned one to see if something would change if we apply it for real. Obviously, I haven't tried that so I may be missing something here. |
We should pick this up soon :) |
Hey! |
@celrenheit This is the client-side scheme, it does not contain conversion/defaulting functions the server-side one contains. |
Oh I see, nvm the silly question |
Kubernetes hasn't been updated in argoproj. The files have been copied and import paths have been adapted. Since argo-cd and gitops-engine use the server scheme from k8s.io/kubernetes we need to work around 'unknown revision 0.0.0' errors, by including replace statements in the go.mod file. kubernetes/issues/79384 Vendoring the argoproj files helps with updating k8s, but is not enough to get rid of the replace statements. argoproj/gitops-engine/issues/56
Kubernetes hasn't been updated in argoproj. The files have been copied and import paths have been adapted. Since argo-cd and gitops-engine use the server scheme from k8s.io/kubernetes we need to work around 'unknown revision 0.0.0' errors, by including replace statements in the go.mod file. kubernetes/issues/79384 Vendoring the argoproj files helps with updating k8s, but is not enough to get rid of the replace statements. argoproj/gitops-engine/issues/56
Kubernetes hasn't been updated in argoproj. The files have been copied and import paths have been adapted. Since argo-cd and gitops-engine use the server scheme from k8s.io/kubernetes we need to work around 'unknown revision 0.0.0' errors, by including replace statements in the go.mod file. kubernetes/issues/79384 Vendoring the argoproj files helps with updating k8s, but is not enough to get rid of the replace statements. argoproj/gitops-engine/issues/56
Kubernetes hasn't been updated in argoproj. The files have been copied and import paths have been adapted. Since argo-cd and gitops-engine use the server scheme from k8s.io/kubernetes we need to work around 'unknown revision 0.0.0' errors, by including replace statements in the go.mod file. kubernetes/issues/79384 Vendoring the argoproj files helps with updating k8s, but is not enough to get rid of the replace statements. argoproj/gitops-engine/issues/56 (cherry picked from commit 701a2f6)
How do you handle custom resources for which conversions/defaulting functions aren't available? |
The last update nearly two years ago was that this would be picked up soon -- is there a way to move the project forward? I spent a day on removing the dependency a year ago but took an approach that ultimately did not work and would not solve the issue. |
The problem with letting this continue to linger is that this really isn't a very reusable library in it's current state. It's quite painful to have to manage the mod file manually. |
Bump. Importing the Argo CD API (e.g. https://pkg.go.dev/github.com/argoproj/argo-cd/[email protected]/pkg/apis/application/v1alpha1) brings in gitops-engine which brings in all of kubernetes and is a maintenance nightmare. |
Are there any updates on this? |
Please consider dropping dependency on
k8s.io/kubernetes
module as it makes the engine really unwieldy to use.Imported:
gitops-engine/pkg/diff/diff.go
Line 27 in 1723191
gitops-engine/pkg/health/health.go
Line 17 in df17961
gitops-engine/pkg/utils/kube/convert.go
Line 7 in 8430dc0
gitops-engine/pkg/utils/kube/ctl.go
Line 29 in 4bd4f29
gitops-engine/pkg/utils/kube/import_known_versions.go
Line 4 in 8430dc0
The text was updated successfully, but these errors were encountered: