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

Import github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1 into operator-sdk project #17019

Closed
3 tasks done
jdomag opened this issue Jan 28, 2024 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@jdomag
Copy link

jdomag commented Jan 28, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug
I tried to import argocd go packages to the controller created with operator-sdk.
I follow the docs of Importing ArgoCD go packages and used latest version of go.mod - I copy/paste 'replace' block to my own go.mod. When I run 'go mod tidy' I got errors presented below.

Version of operator sdk:

operator-sdk version: "v1.32.0", commit: "4dcbbe343b29d325fd8a14cc60366335298b40a3", kubernetes version: "v1.26.0", go version: "go1.21.1", GOOS: "darwin", GOARCH: "arm64"

To Reproduce

Create any controller with operator-sdk and import the package:
argoprojv1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
run go mod tidy

Logs

go: example.com/my-operator/internal/controller imports
        github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1 imports
        github.com/argoproj/gitops-engine/pkg/health imports
        github.com/argoproj/gitops-engine/pkg/utils/kube imports
        github.com/argoproj/gitops-engine/pkg/utils/kube/scheme imports
        k8s.io/kubernetes/pkg/apis/batch/install imports
        k8s.io/kubernetes/pkg/apis/batch/v2alpha1 imports
        k8s.io/api/batch/v2alpha1: module k8s.io/api@latest found (v0.29.1, replaced by k8s.io/[email protected]), but does not contain package k8s.io/api/batch/v2alpha1
go: example.com/my-operator/internal/controller imports
        github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1 imports
        github.com/argoproj/gitops-engine/pkg/health imports
        github.com/argoproj/gitops-engine/pkg/utils/kube imports
        github.com/argoproj/gitops-engine/pkg/utils/kube/scheme imports
        k8s.io/kubernetes/pkg/apis/discovery/install imports
        k8s.io/kubernetes/pkg/apis/discovery/v1alpha1 imports
        k8s.io/api/discovery/v1alpha1: module k8s.io/api@latest found (v0.29.1, replaced by k8s.io/[email protected]), but does not contain package k8s.io/api/discovery/v1alpha1
go: example.com/my-operator/internal/controller imports
        github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1 imports
        github.com/argoproj/gitops-engine/pkg/health imports
        github.com/argoproj/gitops-engine/pkg/utils/kube imports
        github.com/argoproj/gitops-engine/pkg/utils/kube/scheme imports
        k8s.io/kubernetes/pkg/apis/settings/install imports
        k8s.io/kubernetes/pkg/apis/settings/v1alpha1 imports
        k8s.io/api/settings/v1alpha1: module k8s.io/api@latest found (v0.29.1, replaced by k8s.io/[email protected]), but does not contain package k8s.io/api/settings/v1alpha1

This could be related to argoproj/gitops-engine#535
Is there any workaround I can use right now?

@jdomag jdomag added the bug Something isn't working label Jan 28, 2024
@jdomag
Copy link
Author

jdomag commented Jan 29, 2024

heh I should have used
argoprojv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
instead of
argoprojv1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"

@jdomag jdomag closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant