-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
ArgoCD go.mod requires k8s.io/kubernetes directly, resulting in go build unknown revision v0.0.0 #4055
Comments
Usage of this solution is fairly widespread, we could do the same |
We've been using the above linked workaround but ideally we would not need replace directives in every project where we import Argo code. Argo projects should only require and import k8s.io modules as needed. |
@jwelch92 , yeah, that would be ideal. I agree. |
Argo CD imports k8s.io/kubernetes package to perform client-side diffing and execute
|
Hi, I am trying to import |
I saw the workaround recommended above but was wondering if we are looking at a better solution any time soon. Thanks. |
@sidheshdivekar29 What did you end up doing? I'm also having the same issue. |
Hi Adarsh,
I ended up not importing the library.
Since rest apis just post json body, I just defined my own structures for
required rest api.
…On Mon, Nov 9, 2020 at 12:06 PM Adarsh Shah ***@***.***> wrote:
Hi, I am trying to import "
github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" on client side
to populate v1alpha1.AppProjectSpec{} and then json marshal it and send the
data using rest api. I am hitting this exact same issue.
How do I get it working with this bug being open.
@sidheshdivekar29 <https://github.com/sidheshdivekar29> What did you end
up doing? I'm also having the same issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4055 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYCOPO3FQQCMXPAESJC2Q3SPBDTVANCNFSM4PV7WFYQ>
.
--
-Siddhesh.
|
@sidheshdivekar29 Thanks. I was actually able to make it work with v1.5.5. Added following:
|
Great Adarsh, Thanks for letting me know.
On Fri, Nov 13, 2020 at 8:41 AM Adarsh Shah <notifications@github.com>
wrote:
… Hi Adarsh, I ended up not importing the library. Since rest apis just post
json body, I just defined my own structures for required rest api.
… <#m_3495484218996143026_>
On Mon, Nov 9, 2020 at 12:06 PM Adarsh Shah *@*.***> wrote: Hi, I am
trying to import "
github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" on client side
to populate v1alpha1.AppProjectSpec{} and then json marshal it and send the
data using rest api. I am hitting this exact same issue. How do I get it
working with this bug being open. @sidheshdivekar29
<https://github.com/sidheshdivekar29> https://github.com/sidheshdivekar29
What did you end up doing? I'm also having the same issue. — You are
receiving this because you were mentioned. Reply to this email directly,
view it on GitHub <#4055 (comment)
<#4055 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADYCOPO3FQQCMXPAESJC2Q3SPBDTVANCNFSM4PV7WFYQ
.
-- -Siddhesh.
@sidheshdivekar29 <https://github.com/sidheshdivekar29> Thanks. I was
actually able to make it work with v1.5.5.
Added following:
replace (
github.com/argoproj/argo-cd => github.com/argoproj/argo-cd v1.5.5
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4055 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYCOPJ7CURE5XL6WPMIXC3SPVOSDANCNFSM4PV7WFYQ>
.
--
-Siddhesh.
|
There are no direct references to k8s.io/kubernetes anymore. However, projects importing ArgoCD may still face an issue because ArgoCD imports gitops-engine which still uses k8s.io/kubernetes directly. :) |
Hello, Here is my
|
Gracias @dejanzele |
Decided to go with the rest client and marshaling of resources
|
ok after knowing my solution above was a terrible hack with the potential for being a maintenance nightmare I persisted on looking for a better solution and found this article: https://itnext.io/generically-working-with-kubernetes-resources-in-go-53bce678f887 works perfectly for reading resources at least
kudos to https://medium.com/@jsnouff |
We also wanted to use the structs in Any thoughts on that? I assume that the more common reason to take a dependency on |
@yhrn at a glance, I wouldn't be opposed to that refactor... I'm not sure how it might complicate our already-complex codegen code though. |
I also strongly advise to move ArgoCD API definitions in its own module and get rid of replace directives when possible. They greatly complicate the development of third-party integrations for ArgoCD, as they require a lot of painstaking effort to find the correct dependency versions (especially for pre-existing projects which already rely on shared dependencies). |
It is currently impossible to use the last helm sdk with Argo CD modules |
If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a
question in argocd slack channel.
Checklist:
argocd version
. (I'm including the types from 1.6.2)Describe the bug
The ArgoCD go.mod file requires k8s.io/kubernetes instead of individually published kubernetes packages.
https://github.com/argoproj/argo-cd/blob/master/go.mod#L80
kubernetes/kubernetes#79384 (comment)
According to the issue linked above, this is not supported behavior, and leads to issues with including argocd types for use with go-client.
To Reproduce
Add argocd to an external project's go.mod.
Import the argocd types and client into your package.
Attempt to
go build
.Notice you can't
go build
, becausek8s.io/api@v0.0.0
is an unknown revision.Expected behavior
Including argocd types is supported and compiles successfully with
go build
The text was updated successfully, but these errors were encountered: