Skip to content

Commit

Permalink
NoSQLDB spec.
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
  • Loading branch information
artursouza committed Mar 20, 2020
1 parent 7b40dc0 commit de0589e
Show file tree
Hide file tree
Showing 6 changed files with 693 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apis/database/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ var (
PostgreSQLInstanceGroupVersionKind = SchemeGroupVersion.WithKind(PostgreSQLInstanceKind)
)

// NoSQLInstance type metadata.
var (
NoSQLInstanceKind = reflect.TypeOf(NoSQLInstance{}).Name()
NoSQLInstanceGroupKind = schema.GroupKind{Group: Group, Kind: NoSQLInstanceKind}.String()
NoSQLInstanceKindAPIVersion = NoSQLInstanceKind + "." + SchemeGroupVersion.String()
NoSQLInstanceGroupVersionKind = SchemeGroupVersion.WithKind(NoSQLInstanceKind)
)

func init() {
SchemeBuilder.Register(&MySQLInstance{}, &MySQLInstanceList{})
SchemeBuilder.Register(&PostgreSQLInstance{}, &PostgreSQLInstanceList{})
SchemeBuilder.Register(&NoSQLInstance{}, &NoSQLInstanceList{})
}
33 changes: 33 additions & 0 deletions apis/database/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,36 @@ type PostgreSQLInstanceList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []PostgreSQLInstance `json:"items"`
}

// NoSQLInstanceSpec specifies the desired state of a NoSQLInstance.
type NoSQLInstanceSpec struct {
runtimev1alpha1.ResourceClaimSpec `json:",inline"`
}

// +kubebuilder:object:root=true

// A NoSQLInstance is a portable resource claim that may be satisfied by binding
// to a NoSQL managed resource such as an AWS DynamoDB or an Azure CosmosDB instance.
// +kubebuilder:printcolumn:name="STATUS",type="string",JSONPath=".status.bindingPhase"
// +kubebuilder:printcolumn:name="CLASS-KIND",type="string",JSONPath=".spec.classRef.kind"
// +kubebuilder:printcolumn:name="CLASS-NAME",type="string",JSONPath=".spec.classRef.name"
// +kubebuilder:printcolumn:name="RESOURCE-KIND",type="string",JSONPath=".spec.resourceRef.kind"
// +kubebuilder:printcolumn:name="RESOURCE-NAME",type="string",JSONPath=".spec.resourceRef.name"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:subresource:status
type NoSQLInstance struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NoSQLInstanceSpec `json:"spec,omitempty"`
Status runtimev1alpha1.ResourceClaimStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// NoSQLInstanceList contains a list of NoSQLInstance.
type NoSQLInstanceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []NoSQLInstance `json:"items"`
}
60 changes: 60 additions & 0 deletions apis/database/v1alpha1/zz_generated.claim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions apis/database/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit de0589e

Please sign in to comment.