Skip to content

Commit

Permalink
Merge pull request #338 from cybozu-go/d-kuro/support-k8s-1-22
Browse files Browse the repository at this point in the history
Support k8s 1.22 and update dependencies
  • Loading branch information
zoetrope authored Nov 11, 2021
2 parents 184c6e1 + 542aa90 commit 49b18ec
Show file tree
Hide file tree
Showing 20 changed files with 471 additions and 226 deletions.
4 changes: 0 additions & 4 deletions .cr.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
mysql-version: ["8.0.27"]
k8s-version: ["1.19.11", "1.20.7", "1.21.1"]
k8s-version: ["1.20.7", "1.21.2", "1.22.2"]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
strategy:
matrix:
mysql-version: ["8.0.18", "8.0.25", "8.0.26", "8.0.27"]
k8s-version: ["1.21.1"]
k8s-version: ["1.22.2"]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: helm/kind-action@v1.2.0
if: steps.list-changed.outputs.changed == 'true'
with:
node_image: kindest/node:v1.21.2
node_image: kindest/node:v1.22.2

- name: Apply cert-manager
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Tool versions
CTRL_TOOLS_VERSION=0.6.0
CTRL_TOOLS_VERSION=0.7.0
CTRL_RUNTIME_VERSION := $(shell awk '/sigs.k8s.io\/controller-runtime/ {print substr($$2, 2)}' go.mod)
KUSTOMIZE_VERSION = 4.1.3
HELM_VERSION = 3.6.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Blog article: [Introducing MOCO, a modern MySQL operator on Kubernetes](https://
## Supported software

- MySQL: 8.0.18, 8.0.25, 8.0.26, 8.0.27
- Kubernetes: 1.19, 1.20, 1.21
- Kubernetes: 1.20, 1.21, 1.22

Other MySQL 8 releases would probably work. They are simply not tested in our CI.

Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/backuppolicy_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (r *BackupPolicy) SetupWebhookWithManager(mgr ctrl.Manager) error {

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

//+kubebuilder:webhook:path=/validate-moco-cybozu-com-v1beta1-backuppolicy,mutating=false,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=backuppolicies,verbs=create;update;delete,versions=v1beta1,name=vbackuppolicy.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-moco-cybozu-com-v1beta1-backuppolicy,mutating=false,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=backuppolicies,verbs=create;update;delete,versions=v1beta1,name=vbackuppolicy.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &BackupPolicy{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/mysqlcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (r *MySQLCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

//+kubebuilder:webhook:path=/mutate-moco-cybozu-com-v1beta1-mysqlcluster,mutating=true,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=mysqlclusters,verbs=create,versions=v1beta1,name=mmysqlcluster.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/mutate-moco-cybozu-com-v1beta1-mysqlcluster,mutating=true,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=mysqlclusters,verbs=create,versions=v1beta1,name=mmysqlcluster.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &MySQLCluster{}

Expand All @@ -41,7 +41,7 @@ func (r *MySQLCluster) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-moco-cybozu-com-v1beta1-mysqlcluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=mysqlclusters,verbs=create;update,versions=v1beta1,name=vmysqlcluster.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-moco-cybozu-com-v1beta1-mysqlcluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=moco.cybozu.com,resources=mysqlclusters,verbs=create;update,versions=v1beta1,name=vmysqlcluster.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &MySQLCluster{}

Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ var _ = BeforeSuite(func() {
//+kubebuilder:scaffold:webhook

go func() {
defer GinkgoRecover()
err = mgr.Start(ctx)
if err != nil {
Expect(err).NotTo(HaveOccurred())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
controller-gen.kubebuilder.io/version: v0.7.0
labels:
app.kubernetes.io/name: moco
name: backuppolicies.moco.cybozu.com
Expand Down Expand Up @@ -108,8 +108,8 @@ spec:
type: string
value:
description: Variable references $(VAR_NAME) are expanded
using the previous defined environment variables in the
container and any service environment variables.
using the previously defined environment variables in
the container and any service environment variables.
type: string
valueFrom:
description: Source for the environment variable's value.
Expand Down Expand Up @@ -672,6 +672,32 @@ spec:
- kind
- name
type: object
dataSourceRef:
description: Specifies the object from which to
populate the volume with data, if a non-empty
volume is desired. This may be any local object
from a non-empty API group (non core object)
or a PersistentVolumeClaim object.
properties:
apiGroup:
description: APIGroup is the group for the
resource being referenced. If APIGroup is
not specified, the specified Kind must be
in the core API group. For any other third-party
types, APIGroup is required.
type: string
kind:
description: Kind is the type of resource
being referenced
type: string
name:
description: Name is the name of resource
being referenced
type: string
required:
- kind
- name
type: object
resources:
description: 'Resources represents the minimum
resources the volume should have. More info:
Expand Down
Loading

0 comments on commit 49b18ec

Please sign in to comment.