|
| 1 | +package v1alpha1 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | +) |
| 6 | + |
| 7 | +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! |
| 8 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 9 | + |
| 10 | +// PostgresUserSpec defines the desired state of PostgresUser |
| 11 | +// +k8s:openapi-gen=true |
| 12 | +type PostgresUserSpec struct { |
| 13 | + Role string `json:"role"` |
| 14 | + Database string `json:"database"` |
| 15 | + SecretName string `json:"secretName"` |
| 16 | +} |
| 17 | + |
| 18 | +// PostgresUserStatus defines the observed state of PostgresUser |
| 19 | +// +k8s:openapi-gen=true |
| 20 | +type PostgresUserStatus struct { |
| 21 | + Succeeded bool `json:"succeeded"` |
| 22 | + PostgresRole string `json:"postgresRole"` |
| 23 | + PostgresGroup string `json:"postgresGroup"` |
| 24 | + DatabaseName string `json:"databaseName"` |
| 25 | + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster |
| 26 | + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file |
| 27 | + // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html |
| 28 | +} |
| 29 | + |
| 30 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 31 | + |
| 32 | +// PostgresUser is the Schema for the postgresusers API |
| 33 | +// +k8s:openapi-gen=true |
| 34 | +// +kubebuilder:subresource:status |
| 35 | +type PostgresUser struct { |
| 36 | + metav1.TypeMeta `json:",inline"` |
| 37 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 38 | + |
| 39 | + Spec PostgresUserSpec `json:"spec,omitempty"` |
| 40 | + Status PostgresUserStatus `json:"status,omitempty"` |
| 41 | +} |
| 42 | + |
| 43 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 44 | + |
| 45 | +// PostgresUserList contains a list of PostgresUser |
| 46 | +type PostgresUserList struct { |
| 47 | + metav1.TypeMeta `json:",inline"` |
| 48 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 49 | + Items []PostgresUser `json:"items"` |
| 50 | +} |
| 51 | + |
| 52 | +func init() { |
| 53 | + SchemeBuilder.Register(&PostgresUser{}, &PostgresUserList{}) |
| 54 | +} |
0 commit comments