-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fails with "deepcopy.go:885] Hit an unsupported type invalid type for invalid type, from" out of the box #2288
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
Comments
More hints on the issue:
|
Hi @mangelajo, The go version compatible with SDK 0.12 is the 1.13+. See that you need to be in the $GOPATH and the dir paths need to match with the project. E.g for If the above information do not help you sort it out, could you share your code/project? |
Thank you Camila!
I tested with go 1.13+ too, I updated the bug report,
It's not on $GOPATH since we are using GO111MODULES in the project, let me
test
with that, and I'll look at #1853 to see if that sheds some light.
---
irc: ajo / mangelajo
Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo
…On Tue, Dec 3, 2019 at 1:05 PM Camila Macedo ***@***.***> wrote:
Hi @mangelajo <https://github.com/mangelajo>,
The go version compatible with SDK 0.12 is the 1.13+.
Are you with the project created inside of $GOPATH? Also, what is the path
of the project?
It shows the same scenario of #1854 (comment)
<#1854 (comment)>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2288?email_source=notifications&email_token=AAI7G4TD7QMGFPTQDAH543DQWZDSFA5CNFSM4JUVQW42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZEXKA#issuecomment-561138600>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7G4VAS23RZNPO7FVBNUTQWZDSFANCNFSM4JUVQW4Q>
.
|
HI @mangelajo, Note that go do not work well with more than one version installed. So, ensure that you have locally just the 1.13+. |
[root@68d43dc05cf5 submariner-operator]# echo $GOPATH
/go
[root@68d43dc05cf5 submariner-operator]# pwd
/go/src/github.com/submariner-io/submariner-operator
[root@68d43dc05cf5 submariner-operator]# echo $GOROOT
[root@68d43dc05cf5 submariner-operator]# export GOROOT=$GOPATH
[root@68d43dc05cf5 submariner-operator]# operator-sdk generate k8s
INFO[0000] Running deepcopy code-generation for Custom Resource group
versions: [submariner:[v1alpha1], ]
INFO[0000] Code-generation complete.
This was the issue, as soon as GOROOT is set it will work.
I think we may detect this condition from operator-sdk and warn the user
about it. What do you think ?
---
irc: ajo / mangelajo
Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo
…On Tue, Dec 3, 2019 at 1:42 PM Camila Macedo ***@***.***> wrote:
HI @mangelajo <https://github.com/mangelajo>,
Note that go do not work well with more than one version installed. So,
ensure that you have locally just the 1.13+.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2288?email_source=notifications&email_token=AAI7G4W2WSIH5FC276IDDO3QWZH5DA5CNFSM4JUVQW42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZHVGY#issuecomment-561150619>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7G4XA7SPZZX3J444XQ33QWZH5DANCNFSM4JUVQW4Q>
.
|
Sorry, GOROOT must be /usr/lib/golang in my case.
It has to point to the golang installation, otherwise operator-sdk generate
openapi won't work.
…---
irc: ajo / mangelajo
Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo
On Tue, Dec 3, 2019 at 1:56 PM Miguel Angel ***@***.***> wrote:
***@***.*** submariner-operator]# echo $GOPATH
/go
***@***.*** submariner-operator]# pwd
/go/src/github.com/submariner-io/submariner-operator
***@***.*** submariner-operator]# echo $GOROOT
***@***.*** submariner-operator]# export GOROOT=$GOPATH
***@***.*** submariner-operator]# operator-sdk generate k8s
INFO[0000] Running deepcopy code-generation for Custom Resource group
versions: [submariner:[v1alpha1], ]
INFO[0000] Code-generation complete.
This was the issue, as soon as GOROOT is set it will work.
I think we may detect this condition from operator-sdk and warn the user
about it. What do you think ?
---
irc: ajo / mangelajo
Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo
On Tue, Dec 3, 2019 at 1:42 PM Camila Macedo ***@***.***>
wrote:
> HI @mangelajo <https://github.com/mangelajo>,
>
> Note that go do not work well with more than one version installed. So,
> ensure that you have locally just the 1.13+.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2288?email_source=notifications&email_token=AAI7G4W2WSIH5FC276IDDO3QWZH5DA5CNFSM4JUVQW42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZHVGY#issuecomment-561150619>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAI7G4XA7SPZZX3J444XQ33QWZH5DANCNFSM4JUVQW4Q>
> .
>
|
Hi @mangelajo, I am not sure if I understood. Could you fix the local env with the info informed and see it worked or not? |
Hi @mangelajo, I cloned your project locally to check it. See that I am running inside of the GOPATH and with the same path/dir of your project and all worked fine.
Please, let us know if you are ok to close this one or has anything else that you are expecting here. |
Let me close this one. I want to open a new one for better "no GOROOT" handling in some situations where the error message is left to the underlying generators and is very obscure. |
I am still hitting this exact issue:
My environment:
|
I know this is an old one, but it's one of the first results that pops up when I'm googling this error. I was getting this caused by GVM in my environment. For whatever reason it isn't setting the env vars per terminal session. Running |
Like my fellow commenter above, posting my fix which was to set $GOROOT to the directory containing my go installation. E.g. for a go installation at Fixed pull from here: #1854 (comment) |
In my case an upgrade helped - |
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
What did you do?
What did you expect to see?
Working add api
What did you see instead? Under which circumstances?
Environment
and same result with:
go
The text was updated successfully, but these errors were encountered: