Skip to content
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

refactor: remove the enum on scopes #13

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions api/v1alpha1/databaserequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ type DatabaseRequestSpec struct {

//+kubebuilder:required
//+kubebuilder:validation:Required
//+kubebuilder:validation:Enum=production;development;custom
//+kubebuilder:default:=development
// Scope is the scope of the database request
// it can be either "production" or "development" or "custom"
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
Scope string `json:"scope"`

//+kubebuilder:required
Expand Down
5 changes: 1 addition & 4 deletions api/v1alpha1/mongodbprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ type MongoDBConnection struct {
type MongoDBProviderSpec struct {
//+kubebuilder:required
//+kubebuilder:validation:Required
//+kubebuilder:validation:Enum=production;development;custom
//+kubebuilder:default:=development
// Scope is the scope of the database request
// it can be either "production" or "development" or "custom"
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
Scope string `json:"scope"`

//+kubebuilder:validation:MinItems=1
Expand Down
5 changes: 1 addition & 4 deletions api/v1alpha1/relationaldatabaseprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ type RelationalDatabaseProviderSpec struct {

//+kubebuilder:required
//+kubebuilder:validation:Required
//+kubebuilder:validation:Enum=production;development;custom
//+kubebuilder:default:=development
// Scope is the scope of the database request
// it can be either "production" or "development" or "custom"
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
Scope string `json:"scope"`

//+kubebuilder:validation:MinItems=1
Expand Down
10 changes: 2 additions & 8 deletions config/crd/bases/crd.lagoon.sh_databaserequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,8 @@ spec:
for example mariadb-0
type: string
scope:
default: development
description: |-
Scope is the scope of the database request
it can be either "production" or "development" or "custom"
enum:
- production
- development
- custom
description: Scope is the scope of the database request, this is used
to select a provider from a pool of scopes
type: string
seed:
description: |-
Expand Down
261 changes: 0 additions & 261 deletions config/crd/bases/crd.lagoon.sh_mongodbdproviders.yaml

This file was deleted.

10 changes: 2 additions & 8 deletions config/crd/bases/crd.lagoon.sh_mongodbproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,8 @@ spec:
minItems: 1
type: array
scope:
default: development
description: |-
Scope is the scope of the database request
it can be either "production" or "development" or "custom"
enum:
- production
- development
- custom
description: Scope is the scope of the database request, this is used
to select a provider from a pool of scopes
type: string
required:
- connections
Expand Down
10 changes: 2 additions & 8 deletions config/crd/bases/crd.lagoon.sh_relationaldatabaseproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,8 @@ spec:
minItems: 1
type: array
scope:
default: development
description: |-
Scope is the scope of the database request
it can be either "production" or "development" or "custom"
enum:
- production
- development
- custom
description: Scope is the scope of the database request, this is used
to select a provider from a pool of scopes
type: string
type:
description: |-
Expand Down
14 changes: 14 additions & 0 deletions config/samples/crd_v1alpha1_databaserequest_mysql-scope.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: crd.lagoon.sh/v1alpha1
kind: DatabaseRequest
metadata:
labels:
app.kubernetes.io/name: databaserequest
app.kubernetes.io/instance: databaserequest-mysql-scope-sample
app.kubernetes.io/part-of: dbaas-controller
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: dbaas-controller
name: databaserequest-mysql-scope-sample
spec:
name: first-mysql-scope-db
scope: vip-development
type: mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: crd.lagoon.sh/v1alpha1
kind: RelationalDatabaseProvider
metadata:
labels:
app.kubernetes.io/name: dbaas-controller
app.kubernetes.io/managed-by: kustomize
name: relationaldatabaseprovider-mysql-scope-sample
spec:
type: mysql
scope: vip-development
connections:
- name: primary-test-mysql-connection
hostname: mysql-service.mysql
passwordSecretRef:
name: mysql-secret
namespace: mysql
port: 3306
username: root
enabled: true
Loading