podset-operator icon indicating copy to clipboard operation
podset-operator copied to clipboard

Question about imports in the controller

Open bennythejudge opened this issue 5 years ago • 1 comments

You have

	appv1alpha1 "github.com/xcoulon/podset-operator/pkg/apis/app/v1alpha1"

in your podset_controller.go - I was trying to build following the Medium article but I cannot find how to adapt this import for my own local environment. Could you pls help?

I am working in /Users/myuser/go/src/github.com/operator-framework/operator-sdk/podset-operator so I have the above content in /Users/myuser/go/src/github.com/operator-framework/operator-sdk/podset-operator/pkg/apis/app/v1alpha1:

ls -l
total 32
-rw-r--r--  1 myuser  staff   168 Feb  5 22:16 doc.go
-rw-r--r--  1 myuser  staff  1519 Feb  5 22:29 podset_types.go
-rw-r--r--  1 myuser  staff   632 Feb  5 22:16 register.go
-rw-r--r--  1 myuser  staff  3357 Feb  5 22:57 zz_generated.deepcopy.go

Thanks for the article!

bennythejudge avatar Feb 05 '20 22:02 bennythejudge

hello @bennythejudge ah, I see, but it looks like you have a weird path in your project. What about simply moving the project to /Users/myuser/go/src/github.com/bennythejudge/podset-operator and replace all occurrences of xcoulon with bennythejudge in the imports? Having a 3-level path for the repository is a bit unusual, and also, you should not put this example app in the operator-framework/operator-sdk repo, I believe (or at least, I would not recommend it)

xcoulon avatar Feb 06 '20 08:02 xcoulon