Skip to content
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

go mod tidy doesn't work #1

Open
alias-rahil opened this issue Mar 4, 2022 · 11 comments
Open

go mod tidy doesn't work #1

alias-rahil opened this issue Mar 4, 2022 · 11 comments

Comments

@alias-rahil
Copy link

Output go mod tidy:

go: downloading github.com/digitalocean/godo v1.65.0
go: downloading github.com/kanisterio/kanister v0.0.0-20210903215800-f8e63bf1364d
go: downloading github.com/google/go-querystring v1.0.0
go: downloading github.com/jpillora/backoff v1.0.0
go: finding module for package k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset
github.com/viveksinghggits/kluster/pkg/client/informers/internalversion imports
	k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset: module k8s.io/kubernetes@latest found (v1.23.4), but does not contain package k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset

Output go version:

go version go1.17.7 linux/amd64

Output uname -a:

Linux alias-rahil 5.15.25-1-lts #1 SMP Wed, 23 Feb 2022 12:02:12 +0000 x86_64 GNU/Linux
@viveksinghggits
Copy link
Owner

Hi @alias-rahil,
thanks for reporting this, can you confirm if go build works and creates the binary correctly.

@viveksinghggits
Copy link
Owner

Meanwhile I will look into the issue that you reported.

@alias-rahil
Copy link
Author

Yes, go build works correctly

@alias-rahil
Copy link
Author

I was able to determine why the error was occurring. You had accidentally set the metadata type for KlusterList as metav1.ObjectMeta instead of metav1.ListMeta and then you ran the code-generator script.

While you fixed the error at a later stage, the dirty output of the code-generator was still present in the client directory. I will be creating a PR with the fix.

@Kavinraja-G
Copy link

@viveksinghggits Any idea on the above issue ?

@alias-rahil Looks like the k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset package is not available in the latest versions.

@viveksinghggits
Copy link
Owner

Hi @Kavinraja-G,
@alias-rahil was able to figure out why its happening. I also think that he is planning to to push the fix soon. thats being discussed as part of linked PR.

@viveksinghggits
Copy link
Owner

@alias-rahil since we decided not to merge the PR, can you please update the steps here that you followed to make the go mod tidy work locally.

@alias-rahil
Copy link
Author

Sure, These were the files that were accidentally created but are not needed. Removing these files fixes the issue:

  • manifests/viveksingh.dev_klusterlists.yaml
  • pkg/client/informers/internalversion/factory.go
  • pkg/client/informers/internalversion/generic.go
  • pkg/client/informers/internalversion/internalinterfaces/factory_interfaces.go
  • pkg/client/informers/internalversion/v1alpha1/interface.go
  • pkg/client/informers/internalversion/v1alpha1/internalversion/interface.go
  • pkg/client/informers/internalversion/v1alpha1/internalversion/kluster.go
  • pkg/client/listers/v1alpha1/internalversion/expansion_generated.go
  • pkg/client/listers/v1alpha1/internalversion/kluster.go

You should be able to run go mod tidy successfully now :)

@Kavinraja-G
Copy link

What happens to the listers and informers that we use in the controller? If we remove these files @alias-rahil?

Looks like they are being used https://github.com/viveksinghggits/kluster/blob/master/pkg/controller/kluster.go#L12? (correct me if I'm wrong - @viveksinghggits)

@alias-rahil
Copy link
Author

alias-rahil commented Mar 15, 2022

@Kavinraja-G

klister "github.com/viveksinghggits/kluster/pkg/client/listers/viveksingh.dev/v1alpha1"

we aren't deleting this file

We are only deleting the listers from under pkg/client/listers/v1alpha1/internalversion.

@viveksinghggits
Copy link
Owner

Re-opening so that it people can refer this issue, if they get into the same problem.

viveksinghggits added a commit that referenced this issue Jan 1, 2023
Please refer to [this
issue](#1) to figure
out more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants