-
Notifications
You must be signed in to change notification settings - Fork 82
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
Directory structure #25
Comments
main.go -> Starting point ./postgres-crd-v2/pkg/apis/postgrescontroller/v1/types.go -> Definition of Postgres CRD spec |
The structure on the kubernetes sample controller issue 14 has the Controller's logic in another location. I am not sure where these files should live but in the root does not feel right. What do you think? Create the Controller's logic ./pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/samplecontroller_client.go which will act as our goto-structure to access any api-endpoint related to the CustomResource we created. ./pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go which will add the .Foo("") which in turn supplies an interface to operations like:
|
Good point. Makes sense to move the go files in some sub-directory -- one option is to move them in the folder where types.go is defined. In your setup, may be you can try it and see if that change would work or not. If it does then we can make the change here. You will probably need to change import statements in some of the files. |
Rather than refactoring postgres-crd-v2, we can consider these points in any new Operator/custom controller that we will create. Steps to create new custom controller are included in: One of the things that can be considered as part of this process is location of the source code files. So closing this issue. |
I am just trying to understand the directory structure for this project. Especially the .go files under https://github.com/cloud-ark/kubeplus/tree/master/postgres-crd-v2
The text was updated successfully, but these errors were encountered: