postgres-operator/pkg
Oleksii Kliukin e1ed4b847d
Use code-generation for CRD API and deepcopy methods (#369)
Client-go provides a https://github.com/kubernetes/code-generator package in order to provide the API to work with CRDs similar to the one available for built-in types, i.e. Pods, Statefulsets and so on.

Use this package to generate deepcopy methods (required for CRDs), instead of using an external deepcopy package; we also generate APIs used to manipulate both Postgres and OperatorConfiguration CRDs, as well as informers and listers for the Postgres CRD, instead of using generic informers and CRD REST API; by using generated code we can get rid of some custom and obscure CRD-related code and use a better API.

All generated code resides in /pkg/generated, with an exception of zz_deepcopy.go in apis/acid.zalan.do/v1

Rename postgres-operator-configuration CRD to OperatorConfiguration, since the former broke naming convention in the code-generator.

Moved Postgresql, PostgresqlList, OperatorConfiguration and OperatorConfigurationList and other types used by them into

Change the type of  the Error field in the Postgresql crd to a string, so that client-go could generate a deepcopy for it.

Use generated code to set status of CRD objects as well. Right now this is done with patch, however, Kubernetes 1.11 introduces the /status subresources, allowing us to set the status with
the special updateStatus call in the future. For now, we keep the code that is compatible with earlier versions of Kubernetes.

Rename postgresql.go to database.go and status.go to logs_and_api.go to reflect the purpose of each of those files.

Update client-go dependencies.

Minor reformatting and renaming.
2018-08-15 17:22:25 +02:00
..
apis/acid.zalan.do Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
apiserver Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
cluster Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
controller Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
generated Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
spec Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00
util Use code-generation for CRD API and deepcopy methods (#369) 2018-08-15 17:22:25 +02:00