Skip to content

Commit c12be21

Browse files
committed
Update kubebuilder project to v2
1 parent 5a9fd76 commit c12be21

File tree

66 files changed

+722
-113
lines changed

Some content is hidden

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

66 files changed

+722
-113
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ GO_INTEGRATION_TESTS_PARAMS ?= -timeout 50m \
4444

4545
TEST_FILTER_PARAM += $(GO_INTEGRATION_TESTS_PARAMS)
4646

47+
# Kubebuilder v2 compatible paths
48+
CRD_DIR := config/crd/bases
49+
RBAC_DIR := config/rbac
4750

4851
CLUSTER_NAME ?= mysql-operator
4952
delete-environment:

PROJECT

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
version: "1"
1+
version: "2"
22
domain: presslabs.org
3-
repo: github.com/presslabs/mysql-operator
3+
repo: github.com/bitpoke/mysql-operator
4+
resources:
5+
- group: mysql
6+
kind: MysqlCluster
7+
version: v1alpha1
8+
- group: mysql
9+
kind: MysqlBackup
10+
version: v1alpha1
11+
- group: mysql
12+
kind: MysqlDatabase
13+
version: v1alpha1
14+
- group: mysql
15+
kind: MysqlUser
16+
version: v1alpha1
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# The following manifests contain a self-signed issuer CR and a certificate CR.
2+
# More document can be found at https://docs.cert-manager.io
3+
# WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for
4+
# breaking changes
5+
apiVersion: cert-manager.io/v1alpha2
6+
kind: Issuer
7+
metadata:
8+
name: selfsigned-issuer
9+
namespace: system
10+
spec:
11+
selfSigned: {}
12+
---
13+
apiVersion: cert-manager.io/v1alpha2
14+
kind: Certificate
15+
metadata:
16+
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
17+
namespace: system
18+
spec:
19+
# $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize
20+
dnsNames:
21+
- $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc
22+
- $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local
23+
issuerRef:
24+
kind: Issuer
25+
name: selfsigned-issuer
26+
secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resources:
2+
- certificate.yaml
3+
4+
configurations:
5+
- kustomizeconfig.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This configuration is for teaching kustomize how to update name ref and var substitution
2+
nameReference:
3+
- kind: Issuer
4+
group: cert-manager.io
5+
fieldSpecs:
6+
- kind: Certificate
7+
group: cert-manager.io
8+
path: spec/issuerRef/name
9+
10+
varReference:
11+
- kind: Certificate
12+
group: cert-manager.io
13+
path: spec/commonName
14+
- kind: Certificate
15+
group: cert-manager.io
16+
path: spec/dnsNames
File renamed without changes.
File renamed without changes.

config/crds/mysql.presslabs.org_mysqldatabases.yaml renamed to config/crd/bases/mysql.presslabs.org_mysqldatabases.yaml

File renamed without changes.
File renamed without changes.

config/crd/kustomization.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This kustomization.yaml is not intended to be run by itself,
2+
# since it depends on service name and namespace that are out of this kustomize package.
3+
# It should be run by config/default
4+
resources:
5+
- bases/mysql.presslabs.org_mysqlclusters.yaml
6+
- bases/mysql.presslabs.org_mysqlbackups.yaml
7+
- bases/mysql.presslabs.org_mysqlusers.yaml
8+
- bases/mysql.presslabs.org_mysqldatabases.yaml
9+
# +kubebuilder:scaffold:crdkustomizeresource
10+
11+
patchesStrategicMerge:
12+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
13+
# patches here are for enabling the conversion webhook for each CRD
14+
#- patches/webhook_in_mysqlclusters.yaml
15+
#- patches/webhook_in_mysqlbackups.yaml
16+
#- patches/webhook_in_mysqlusers.yaml
17+
#- patches/webhook_in_mysqldatabases.yaml
18+
# +kubebuilder:scaffold:crdkustomizewebhookpatch
19+
20+
# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
21+
# patches here are for enabling the CA injection for each CRD
22+
#- patches/cainjection_in_mysqlclusters.yaml
23+
#- patches/cainjection_in_mysqlbackups.yaml
24+
#- patches/cainjection_in_mysqlusers.yaml
25+
#- patches/cainjection_in_mysqldatabases.yaml
26+
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
27+
28+
# the following config is for teaching kustomize how to do kustomization for CRDs.
29+
configurations:
30+
- kustomizeconfig.yaml

0 commit comments

Comments
 (0)