Skip to content

Commit

Permalink
Merge pull request #2 from pluralsh/master
Browse files Browse the repository at this point in the history
print status for the request
  • Loading branch information
zreigz committed Oct 6, 2022
2 parents 7114c79 + fc94165 commit 01d3572
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 38 deletions.
2 changes: 1 addition & 1 deletion apis/database/v1alpha1/databaseaccess_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type DatabaseAccessSpec struct {
DatabaseRequestName string `json:"databaseRequestName"`

// DatabaseAccessClassName is the name of the DatabaseAccessClass
DatabaseAccessClassName string `json:"bucketAccessClassName"`
DatabaseAccessClassName string `json:"databaseAccessClassName"`

// CredentialsSecretName is the name of the secret that operator should populate
// with the credentials. If a secret by this name already exists, then it is
Expand Down
38 changes: 38 additions & 0 deletions apis/database/v1alpha1/databaseaccessclass_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package v1alpha1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

func init() {
SchemeBuilder.Register(&DatabaseAccessClass{}, &DatabaseAccessClassList{})
}

type AuthenticationType string

// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type DatabaseAccessClass struct {
metav1.TypeMeta `json:",inline"`

// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

// DriverName is the name of driver associated with
// this DatabaseAccess
DriverName string `json:"driverName"`

// AuthenticationType denotes the style of authentication
AuthenticationType AuthenticationType `json:"authenticationType"`

// Parameters is an opaque map for passing in configuration to a driver
// for granting access to a bucket
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type DatabaseAccessClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DatabaseAccessClass `json:"items"`
}
32 changes: 0 additions & 32 deletions apis/database/v1alpha1/databaseclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

func init() {
SchemeBuilder.Register(&DatabaseClass{}, &DatabaseClassList{})
SchemeBuilder.Register(&DatabaseAccessClass{}, &DatabaseAccessClassList{})
}

type AuthenticationType string

// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type DatabaseClass struct {
Expand All @@ -49,32 +46,3 @@ type DatabaseClassList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []DatabaseClass `json:"items"`
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
type DatabaseAccessClass struct {
metav1.TypeMeta `json:",inline"`

// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`

// DriverName is the name of driver associated with
// this DatabaseAccess
DriverName string `json:"driverName"`

// AuthenticationType denotes the style of authentication
AuthenticationType AuthenticationType `json:"authenticationType"`

// Parameters is an opaque map for passing in configuration to a driver
// for granting access to a bucket
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type DatabaseAccessClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []DatabaseAccessClass `json:"items"`
}
3 changes: 3 additions & 0 deletions apis/database/v1alpha1/databaserequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type DatabaseRequestStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Database ready status"
// +kubebuilder:printcolumn:name="Database",type="string",JSONPath=".status.databaseName",description="Database name"

type DatabaseRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/database.plural.sh_databaseaccesses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ spec:
type: object
spec:
properties:
bucketAccessClassName:
description: DatabaseAccessClassName is the name of the DatabaseAccessClass
type: string
credentialsSecretName:
description: CredentialsSecretName is the name of the secret that
operator should populate with the credentials. If a secret by this
name already exists, then it is assumed that credentials have already
been generated. It is not overridden. This secret is deleted when
the DatabaseAccess is delted.
type: string
databaseAccessClassName:
description: DatabaseAccessClassName is the name of the DatabaseAccessClass
type: string
databaseRequestName:
description: DatabaseRequestName is the name of the DatabaseRequest.
type: string
required:
- bucketAccessClassName
- credentialsSecretName
- databaseAccessClassName
- databaseRequestName
type: object
status:
Expand Down
11 changes: 10 additions & 1 deletion config/crd/bases/database.plural.sh_databaserequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: databaserequest
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Database ready status
jsonPath: .status.ready
name: Ready
type: string
- description: Database name
jsonPath: .status.databaseName
name: Database
type: string
name: v1alpha1
schema:
openAPIV3Schema:
properties:
Expand Down

0 comments on commit 01d3572

Please sign in to comment.