Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit c869fc3

Browse files
prydieowainlewis
authored andcommitted
Migrate API version from v1 -> v1alpha1 (#122)
1 parent 23e2cda commit c869fc3

File tree

118 files changed

+845
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+845
-855
lines changed

cmd/mysql-agent/app/mysql_agent.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
backupcontroller "github.com/oracle/mysql-operator/pkg/controllers/backup"
3838
clustermgr "github.com/oracle/mysql-operator/pkg/controllers/cluster/manager"
3939
restorecontroller "github.com/oracle/mysql-operator/pkg/controllers/restore"
40-
mysqlop "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned"
40+
clientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned"
4141
informers "github.com/oracle/mysql-operator/pkg/generated/informers/externalversions"
4242
metrics "github.com/oracle/mysql-operator/pkg/util/metrics"
4343
signals "github.com/oracle/mysql-operator/pkg/util/signals"
@@ -83,7 +83,7 @@ func Run(opts *options.MySQLAgentOpts) error {
8383
}()
8484

8585
kubeclient := kubernetes.NewForConfigOrDie(kubeconfig)
86-
mysqlopClient := mysqlop.NewForConfigOrDie(kubeconfig)
86+
mysqlopClient := clientset.NewForConfigOrDie(kubeconfig)
8787

8888
sharedInformerFactory := informers.NewFilteredSharedInformerFactory(mysqlopClient, 0, opts.Namespace, nil)
8989
kubeInformerFactory := kubeinformers.NewFilteredSharedInformerFactory(kubeclient, resyncPeriod(opts)(), opts.Namespace, nil)
@@ -116,9 +116,9 @@ func Run(opts *options.MySQLAgentOpts) error {
116116

117117
backupController := backupcontroller.NewAgentController(
118118
kubeclient,
119-
mysqlopClient.MysqlV1(),
120-
sharedInformerFactory.Mysql().V1().MySQLBackups(),
121-
sharedInformerFactory.Mysql().V1().MySQLClusters(),
119+
mysqlopClient.MysqlV1alpha1(),
120+
sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(),
121+
sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(),
122122
kubeInformerFactory.Core().V1().Pods(),
123123
opts.Hostname,
124124
)
@@ -130,10 +130,10 @@ func Run(opts *options.MySQLAgentOpts) error {
130130

131131
restoreController := restorecontroller.NewAgentController(
132132
kubeclient,
133-
mysqlopClient.MysqlV1(),
134-
sharedInformerFactory.Mysql().V1().MySQLRestores(),
135-
sharedInformerFactory.Mysql().V1().MySQLClusters(),
136-
sharedInformerFactory.Mysql().V1().MySQLBackups(),
133+
mysqlopClient.MysqlV1alpha1(),
134+
sharedInformerFactory.Mysql().V1alpha1().MySQLRestores(),
135+
sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(),
136+
sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(),
137137
kubeInformerFactory.Core().V1().Pods(),
138138
opts.Hostname,
139139
)

cmd/mysql-operator/app/mysql_operator.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
backupschedule "github.com/oracle/mysql-operator/pkg/controllers/backup/schedule"
3434
cluster "github.com/oracle/mysql-operator/pkg/controllers/cluster"
3535
restorecontroller "github.com/oracle/mysql-operator/pkg/controllers/restore"
36-
mysqlop "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned"
36+
clientset "github.com/oracle/mysql-operator/pkg/generated/clientset/versioned"
3737
informers "github.com/oracle/mysql-operator/pkg/generated/informers/externalversions"
3838
metrics "github.com/oracle/mysql-operator/pkg/util/metrics"
3939
signals "github.com/oracle/mysql-operator/pkg/util/signals"
@@ -71,7 +71,7 @@ func Run(s *options.MySQLOperatorServer) error {
7171
signals.SetupSignalHandler(cancelFunc)
7272

7373
kubeClient := kubernetes.NewForConfigOrDie(kubeconfig)
74-
mysqlopClient := mysqlop.NewForConfigOrDie(kubeconfig)
74+
mysqlopClient := clientset.NewForConfigOrDie(kubeconfig)
7575

7676
// Shared informers (non namespace specific).
7777
operatorInformerFactory := informers.NewFilteredSharedInformerFactory(mysqlopClient, resyncPeriod(s)(), s.Namespace, nil)
@@ -83,7 +83,7 @@ func Run(s *options.MySQLOperatorServer) error {
8383
*s,
8484
mysqlopClient,
8585
kubeClient,
86-
operatorInformerFactory.Mysql().V1().MySQLClusters(),
86+
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
8787
kubeInformerFactory.Apps().V1beta1().StatefulSets(),
8888
kubeInformerFactory.Core().V1().Pods(),
8989
kubeInformerFactory.Core().V1().Services(),
@@ -98,9 +98,9 @@ func Run(s *options.MySQLOperatorServer) error {
9898

9999
backupController := backupcontroller.NewOperatorController(
100100
kubeClient,
101-
mysqlopClient.MysqlV1(),
102-
operatorInformerFactory.Mysql().V1().MySQLBackups(),
103-
operatorInformerFactory.Mysql().V1().MySQLClusters(),
101+
mysqlopClient.MysqlV1alpha1(),
102+
operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(),
103+
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
104104
kubeInformerFactory.Core().V1().Pods(),
105105
)
106106
wg.Add(1)
@@ -111,10 +111,10 @@ func Run(s *options.MySQLOperatorServer) error {
111111

112112
restoreController := restorecontroller.NewOperatorController(
113113
kubeClient,
114-
mysqlopClient.MysqlV1(),
115-
operatorInformerFactory.Mysql().V1().MySQLRestores(),
116-
operatorInformerFactory.Mysql().V1().MySQLClusters(),
117-
operatorInformerFactory.Mysql().V1().MySQLBackups(),
114+
mysqlopClient.MysqlV1alpha1(),
115+
operatorInformerFactory.Mysql().V1alpha1().MySQLRestores(),
116+
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
117+
operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(),
118118
kubeInformerFactory.Core().V1().Pods(),
119119
)
120120
wg.Add(1)
@@ -126,7 +126,7 @@ func Run(s *options.MySQLOperatorServer) error {
126126
backupScheduleController := backupschedule.NewController(
127127
mysqlopClient,
128128
kubeClient,
129-
operatorInformerFactory.Mysql().V1().MySQLBackupSchedules(),
129+
operatorInformerFactory.Mysql().V1alpha1().MySQLBackupSchedules(),
130130
30*time.Second,
131131
s.Namespace,
132132
)

contrib/manifests/custom-resource-definitions.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: mysqlclusters.mysql.oracle.com
66
spec:
77
group: mysql.oracle.com
8-
version: v1
8+
version: v1alpha1
99
scope: Namespaced
1010
names:
1111
kind: MySQLCluster
@@ -18,7 +18,7 @@ metadata:
1818
name: mysqlbackups.mysql.oracle.com
1919
spec:
2020
group: mysql.oracle.com
21-
version: v1
21+
version: v1alpha1
2222
scope: Namespaced
2323
names:
2424
kind: MySQLBackup
@@ -31,7 +31,7 @@ metadata:
3131
name: mysqlrestores.mysql.oracle.com
3232
spec:
3333
group: mysql.oracle.com
34-
version: v1
34+
version: v1alpha1
3535
scope: Namespaced
3636
names:
3737
kind: MySQLRestore
@@ -44,7 +44,7 @@ metadata:
4444
name: mysqlbackupschedules.mysql.oracle.com
4545
spec:
4646
group: mysql.oracle.com
47-
version: v1
47+
version: v1alpha1
4848
scope: Namespaced
4949
names:
5050
kind: MySQLBackupSchedule

docs/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ You should now have a cluster in the default namespace
126126
```
127127
$ kubectl get mysqlclusters
128128
NAME KIND
129-
myappdb MySQLCluster.v1.mysql.oracle.com
129+
myappdb MySQLCluster.v1alpha1.mysql.oracle.com
130130
```
131131

132132
To find out how to create larger clusters, and configure storage see [Clusters](user/clusters.md#clusters).

docs/user/backup.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ operator. The secretRef is the name of a secret that contains your Object
4040
Storage credentials. Note: The databases field is mandatory.
4141

4242
```yaml
43-
apiVersion: "mysql.oracle.com/v1"
43+
apiVersion: mysql.oracle.com/v1alpa1
4444
kind: MySQLBackup
4545
metadata:
4646
name: mysql-backup
@@ -63,30 +63,30 @@ spec:
6363
6464
### On-demand backups - executor configuration
6565
66-
A backup spec requires an 'executor' to support the backup and restore of
66+
A backup spec requires an 'executor' to support the backup and restore of
6767
database content.
6868
69-
Currently, the 'mysqldump' utility is provided, although further executors may
69+
Currently, the 'mysqldump' utility is provided, although further executors may
7070
be added in the future.
7171
72-
You should additionally configure the list of databases to include in the
72+
You should additionally configure the list of databases to include in the
7373
backup.
7474
7575
### On-demand backups - storage configuration
7676
77-
A backup spec requires a 'storage' mechanism to save the backed up
77+
A backup spec requires a 'storage' mechanism to save the backed up
7878
content of a database.
7979
80-
Currently, 'S3' based object storage is provided, although further providers
80+
Currently, 'S3' based object storage is provided, although further providers
8181
may be added in the future.
8282
8383
#### On-demand backups - OCI S3 storage configuration
8484
85-
When configuring an S3 endpoint you should ensure that it is correct for your
86-
backing provider and that you have pre-created the desired bucket.
85+
When configuring an S3 endpoint you should ensure that it is correct for your
86+
backing provider and that you have pre-created the desired bucket.
8787
88-
For example, An Oracle OCI backend for the tenancy 'mytenancy', region
89-
'us-phoenix-1', and bucket 'mybucket', should have the storage element
88+
For example, An Oracle OCI backend for the tenancy 'mytenancy', region
89+
'us-phoenix-1', and bucket 'mybucket', should have the storage element
9090
configured as follows:
9191
9292
```yaml
@@ -98,7 +98,7 @@ configured as follows:
9898
...
9999
```
100100

101-
The bucket should also be valid for the secret credentials specified previously.
101+
The bucket should also be valid for the secret credentials specified previously.
102102

103103
#### On-demand backups - Amazon S3 storage configuration
104104

@@ -146,7 +146,7 @@ databases field is mandatory. For example, the following will create a backup
146146
of the employees database every 30 minutes:
147147

148148
```yaml
149-
apiVersion: "mysql.oracle.com/v1"
149+
apiVersion: mysql.oracle.com/v1alpha1
150150
kind: MySQLBackupSchedule
151151
metadata:
152152
name: mysql-backup-schedule

docs/user/clusters.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MySQL cluster examples.
77
The following example will create a MySQL Cluster with 3 replicas, one primary and 2 secondaries:
88

99
```yaml
10-
apiVersion: "mysql.oracle.com/v1"
10+
apiVersion: mysql.oracle.com/v1alpha1
1111
kind: MySQLCluster
1212
metadata:
1313
name: mysql-test-cluster
@@ -20,7 +20,7 @@ spec:
2020
The following example will create a MySQL Cluster with 3 primary (read/write) replicas:
2121
2222
```yaml
23-
apiVersion: "mysql.oracle.com/v1"
23+
apiVersion: mysql.oracle.com/v1alpha1
2424
kind: MySQLCluster
2525
metadata:
2626
name: mysql-multimaster-cluster
@@ -40,7 +40,7 @@ $ kubectl create secret generic mysql-root-user-secret --from-literal=password=f
4040
Create your cluster and reference it
4141

4242
```yaml
43-
apiVersion: "mysql.oracle.com/v1"
43+
apiVersion: mysql.oracle.com/v1alpha1
4444
kind: MySQLCluster
4545
metadata:
4646
name: example-mysql-cluster-custom-secret
@@ -72,7 +72,7 @@ spec:
7272
persistentVolumeReclaimPolicy: Recycle
7373
storageClassName: manual
7474
---
75-
apiVersion: "mysql.oracle.com/v1"
75+
apiVersion: mysql.oracle.com/v1alpha1
7676
kind: MySQLCluster
7777
metadata:
7878
name: example-mysql-cluster-with-volume
@@ -129,7 +129,7 @@ spec:
129129
persistentVolumeReclaimPolicy: Recycle
130130
storageClassName: manual
131131
---
132-
apiVersion: "mysql.oracle.com/v1"
132+
apiVersion: mysql.oracle.com/v1alpha1
133133
kind: MySQLCluster
134134
metadata:
135135
name: example-mysql-cluster-with-volume
@@ -179,7 +179,7 @@ kubectl create configmap mycnf --from-file=examples/my.cnf
179179
Now we can reference our config map in our cluster spec definition. For example:
180180

181181
```yaml
182-
apiVersion: "mysql.oracle.com/v1"
182+
apiVersion: mysql.oracle.com/v1alpha1
183183
kind: MySQLCluster
184184
metadata:
185185
name: mysql-cluster-with-config
@@ -194,7 +194,7 @@ By default, the MySQL Operator starts a cluster with `--server_id` set to `1000`
194194

195195
The following example will create a MySQL Cluster with following `server_id`'s: 42,43,44
196196
```yaml
197-
apiVersion: "mysql.oracle.com/v1"
197+
apiVersion: mysql.oracle.com/v1alpha1
198198
kind: MySQLCluster
199199
metadata:
200200
name: mysql-cluster-with-custom-serverid

docs/user/restore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ backup that you wish to restore, and the clusterRef is the name of the
1010
destination cluster of the restore operation.
1111

1212
```yaml
13-
apiVersion: "mysql.oracle.com/v1"
13+
apiVersion: mysql.oracle.com/v1alpha1
1414
kind: MySQLRestore
1515
metadata:
1616
name: example-restore

docs/user/router.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Typically the MySQL Router is deployed [alongside your application][2].
1717
We'll use WordPress as an example of how you might setup the MySQL Router for a a real application. The first thing we want to do is create our MySQL Cluster using the operator.
1818

1919
```yaml
20-
apiVersion: "mysql.oracle.com/v1"
20+
apiVersion: "mysql.oracle.com/v1alpa1"
2121
kind: MySQLCluster
2222
metadata:
2323
name: mysql-wordpress

examples/backup/backup-schedule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLBackupSchedule
33
metadata:
44
name: mysql-backup-schedule

examples/backup/backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLBackup
33
metadata:
44
name: mysql-backup

examples/cluster/cluster-with-3-replicas.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/cluster/cluster-with-custom-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/cluster/cluster-with-custom-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/cluster/cluster-with-custom-ssl-certs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/cluster/cluster-with-data-volume-and-backup-volume.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
persistentVolumeReclaimPolicy: Recycle
3232
storageClassName: manual
3333
---
34-
apiVersion: "mysql.oracle.com/v1"
34+
apiVersion: mysql.oracle.com/v1alpha1
3535
kind: MySQLCluster
3636
metadata:
3737
name: mysql

examples/cluster/cluster-with-volume.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
persistentVolumeReclaimPolicy: Recycle
1616
storageClassName: manual
1717
---
18-
apiVersion: "mysql.oracle.com/v1"
18+
apiVersion: mysql.oracle.com/v1alpha1
1919
kind: MySQLCluster
2020
metadata:
2121
name: mysql

examples/cluster/cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/cluster/multi-master-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLCluster
33
metadata:
44
name: mysql

examples/demo/wordpress-router/wordpress-database.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ metadata:
1515
data:
1616
password: bXktc3VwZXItc2VjcmV0LXBhc3M=
1717
---
18-
apiVersion: "mysql.oracle.com/v1"
18+
apiVersion: mysql.oracle.com/v1alpha1
1919
kind: MySQLCluster
2020
metadata:
2121
name: mysql-wordpress

examples/demo/wordpress/wordpress-database.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
persistentVolumeReclaimPolicy: Recycle
1616
storageClassName: manual
1717
---
18-
apiVersion: "mysql.oracle.com/v1"
18+
apiVersion: mysql.oracle.com/v1alpha1
1919
kind: MySQLCluster
2020
metadata:
2121
name: mysql-wordpress

examples/restore/restore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: "mysql.oracle.com/v1"
1+
apiVersion: mysql.oracle.com/v1alpha1
22
kind: MySQLRestore
33
metadata:
44
name: mysql-restore

0 commit comments

Comments
 (0)