Skip to content

Commit e5ec07c

Browse files
committed
refactor: rename scope to selector
1 parent 297b7f0 commit e5ec07c

23 files changed

+84
-81
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Use the status connectionStatus field to check the status of the MySQL connectio
8383
### RelationalDatabaseProvider Spec Fields
8484

8585
- kind (required): The type of database provider, which can be either mysql or postgresql.
86-
- scope (required): Defines the scope of the database request, which influences the environment setup. Valid values are production, development, and custom. Defaults to development if not specified.
86+
- selector (required): Defines the selector of the database request, which influences the environment setup. Valid values are production, development, and custom. Defaults to development if not specified.
8787
- connections (required): A list of `connection` objects that detail the connection parameters to MySQL or PostgreSQL databases. At least one connection must be defined.
8888

8989
- connection Fields
@@ -116,7 +116,7 @@ metadata:
116116
name: example-mysql-provider
117117
spec:
118118
kind: mysql
119-
scope: development
119+
selector: development
120120
mysqlConnections:
121121
- name: primary-db
122122
hostname: primary-db.example.com
@@ -130,12 +130,12 @@ spec:
130130
131131
## DatabaseRequest CRD Documentation
132132
133-
The `DatabaseRequest` Custom Resource Definition (CRD) provides a mechanism for requesting database instances within a Kubernetes cluster. This resource allows lagoon to specify their requirements for a database, including the type, scope, and optional parameters such as seeding data, additional users, and database connection references. This documentation outlines the structure and functionality of the `DatabaseRequest` resource to facilitate its usage.
133+
The `DatabaseRequest` Custom Resource Definition (CRD) provides a mechanism for requesting database instances within a Kubernetes cluster. This resource allows lagoon to specify their requirements for a database, including the type, selector, and optional parameters such as seeding data, additional users, and database connection references. This documentation outlines the structure and functionality of the `DatabaseRequest` resource to facilitate its usage.
134134

135135
### DatabaseRequest Spec Fields
136136

137137
- name (required): Defines the intended service name for the database. This field is required and must be unique within the namespace.
138-
- scope (required): Defines the intended use of the requested database. It helps in configuring the database appropriately for its intended environment. Valid options are production, development, and custom. The default value is development.
138+
- selector (required): Defines the intended use of the requested database. It helps in configuring the database appropriately for its intended environment. Valid options are production, development, and custom. The default value is development.
139139
- type (required): Specifies the type of database requested. Supported types are mysql, mariadb, postgres, and mongodb.
140140
- seed (optional): A reference to a local Kubernetes secret within the same namespace that contains data used for seeding the database. This field is optional and intended for initial database setup.
141141
- additionalUsers (optional): Specifies the creation of additional database users.
@@ -162,7 +162,7 @@ kind: DatabaseRequest
162162
metadata:
163163
name: example-database-request
164164
spec:
165-
scope: development
165+
selector: development
166166
type: mysql
167167
additionalUsers:
168168
type: read-write

api/v1alpha1/databaserequest_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ type DatabaseRequestSpec struct {
6060

6161
//+kubebuilder:required
6262
//+kubebuilder:validation:Required
63-
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
64-
Scope string `json:"scope"`
63+
// Selector is the name of the database request, this is used to select a provider from a pool of providers with the same selector
64+
Selector string `json:"selector"`
6565

6666
//+kubebuilder:required
6767
//+kubebuilder:validation:Required

api/v1alpha1/mongodbprovider_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ type MongoDBConnection struct {
8989
type MongoDBProviderSpec struct {
9090
//+kubebuilder:required
9191
//+kubebuilder:validation:Required
92-
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
93-
Scope string `json:"scope"`
92+
// Selector is the name of the database request, this is used to select a provider from a pool of providers with the same selector
93+
Selector string `json:"selector"`
9494

9595
//+kubebuilder:validation:MinItems=1
9696
// Connections defines the connection to a relational database

api/v1alpha1/relationaldatabaseprovider_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ type RelationalDatabaseProviderSpec struct {
7171

7272
//+kubebuilder:required
7373
//+kubebuilder:validation:Required
74-
// Scope is the scope of the database request, this is used to select a provider from a pool of scopes
75-
Scope string `json:"scope"`
74+
// Selector is the name of the database request, this is used to select a provider from a pool of providers with the same selector
75+
Selector string `json:"selector"`
7676

7777
//+kubebuilder:validation:MinItems=1
7878
// Connections defines the connection to a relational database

config/crd/bases/crd.lagoon.sh_databaserequests.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ spec:
137137
Name is used for the service name and the prefix in the secret data
138138
for example mariadb-0
139139
type: string
140-
scope:
141-
description: Scope is the scope of the database request, this is used
142-
to select a provider from a pool of scopes
143-
type: string
144140
seed:
145141
description: |-
146142
Seed is the seed for the database request
@@ -156,6 +152,11 @@ spec:
156152
type: string
157153
type: object
158154
x-kubernetes-map-type: atomic
155+
selector:
156+
description: Selector is the name of the database request, this is
157+
used to select a provider from a pool of providers with the same
158+
selector
159+
type: string
159160
type:
160161
description: |-
161162
Type is the type of the database request
@@ -168,7 +169,7 @@ spec:
168169
type: string
169170
required:
170171
- name
171-
- scope
172+
- selector
172173
- type
173174
type: object
174175
status:

config/crd/bases/crd.lagoon.sh_mongodbproviders.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ spec:
124124
type: object
125125
minItems: 1
126126
type: array
127-
scope:
128-
description: Scope is the scope of the database request, this is used
129-
to select a provider from a pool of scopes
127+
selector:
128+
description: Selector is the name of the database request, this is
129+
used to select a provider from a pool of providers with the same
130+
selector
130131
type: string
131132
required:
132133
- connections
133-
- scope
134+
- selector
134135
type: object
135136
status:
136137
description: MongoDBProviderStatus defines the observed state of MongoDBProvider

config/crd/bases/crd.lagoon.sh_relationaldatabaseproviders.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ spec:
100100
type: object
101101
minItems: 1
102102
type: array
103-
scope:
104-
description: Scope is the scope of the database request, this is used
105-
to select a provider from a pool of scopes
103+
selector:
104+
description: Selector is the name of the database request, this is
105+
used to select a provider from a pool of providers with the same
106+
selector
106107
type: string
107108
type:
108109
description: |-
@@ -114,7 +115,7 @@ spec:
114115
type: string
115116
required:
116117
- connections
117-
- scope
118+
- selector
118119
- type
119120
type: object
120121
status:

config/samples/crd_v1alpha1_databaserequest_mysql-scope.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ metadata:
1010
name: databaserequest-mysql-scope-sample
1111
spec:
1212
name: first-mysql-scope-db
13-
scope: vip-development
13+
selector: vip-development
1414
type: mysql

config/samples/crd_v1alpha1_databaserequest_mysql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ metadata:
1010
name: databaserequest-mysql-sample
1111
spec:
1212
name: first-mysql-db
13-
scope: development
13+
selector: development
1414
type: mysql

config/samples/crd_v1alpha1_databaserequest_postgres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ metadata:
1010
name: databaserequest-postgres-sample
1111
spec:
1212
name: first-postgres-db
13-
scope: development
13+
selector: development
1414
type: postgres

0 commit comments

Comments
 (0)