Skip to content

Commit

Permalink
refactor: remove the enum on scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Sep 16, 2024
1 parent 378d037 commit ada3953
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 318 deletions.
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

0 comments on commit ada3953

Please sign in to comment.