Skip to content

Commit

Permalink
Merge pull request #55 from cybozu-go/update-go-and-k8s-versions
Browse files Browse the repository at this point in the history
Update versions of go, k8s, and stuff
  • Loading branch information
satoru-takeuchi authored Oct 25, 2024
2 parents da5624d + 1e58b4c commit f6d369a
Show file tree
Hide file tree
Showing 26 changed files with 225 additions and 553 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ linters:
enable:
- dupl
- errcheck
- exportloopref
- copyloopvar
- goconst
- gocyclo
- gofmt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.22 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ test: manifests generate fmt vet envtest mock ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_KUBERNETES_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out -p 1 -v

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ To use mantle on your real kubernetes cluster, read following sections.

### Prerequisites
- Deploy
- Kubernetes cluster: v1.27.10+
- Kubernetes cluster: v1.29.8+
- Rook: v1.13.1+
- build
- go: v1.21.0+
- go: v1.22.0+
- docker: 20.10+
- kubectl: v1.27.10+
- kubectl: v1.29.8+
- kubebuilder: 3.14.0+

### To Deploy on the cluster
Expand Down
1 change: 0 additions & 1 deletion api/v1/mantlebackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type MantleBackupSpec struct {
PVC string `json:"pvc,omitempty"`

// 'namespace' specifies backup target Namespace
// +kubebuilder:validation:Required
Namespace string `json:"namespace,omitempty"`

// NOTE: we CANNOT use metav1.Duration for Expire due to an unresolved k8s bug.
Expand Down
89 changes: 9 additions & 80 deletions charts/mantle-cluster-wide/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ rules:
- apiGroups:
- ""
resources:
- persistentvolumeclaims
- configmaps
- pods
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
- persistentvolumes
verbs:
- create
Expand All @@ -40,60 +39,12 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackupconfigs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackupconfigs/finalizers
verbs:
- update
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackupconfigs/status
verbs:
- get
- patch
- update
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackups
- mantlerestores
verbs:
- create
- delete
Expand All @@ -105,13 +56,17 @@ rules:
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackupconfigs/finalizers
- mantlebackups/finalizers
- mantlerestores/finalizers
verbs:
- update
- apiGroups:
- mantle.cybozu.io
resources:
- mantlebackupconfigs/status
- mantlebackups/status
- mantlerestores/status
verbs:
- get
- patch
Expand All @@ -124,32 +79,6 @@ rules:
- get
- list
- watch
- apiGroups:
- mantle.cybozu.io
resources:
- mantlerestores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mantle.cybozu.io
resources:
- mantlerestores/finalizers
verbs:
- update
- apiGroups:
- mantle.cybozu.io
resources:
- mantlerestores/status
verbs:
- get
- patch
- update
- apiGroups:
- storage.k8s.io
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.4
name: mantlebackupconfigs.mantle.cybozu.io
spec:
group: mantle.cybozu.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.4
name: mantlebackups.mantle.cybozu.io
spec:
group: mantle.cybozu.io
Expand Down Expand Up @@ -61,23 +61,16 @@ spec:
type: string
required:
- expire
- pvc
type: object
status:
description: MantleBackupStatus defines the observed state of MantleBackup
properties:
conditions:
description: '''conditions'' specifies current backup conditions'
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
Expand Down Expand Up @@ -118,12 +111,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.4
name: mantlerestores.mantle.cybozu.io
spec:
group: mantle.cybozu.io
Expand Down Expand Up @@ -43,6 +43,8 @@ spec:
description: '''backup'' specifies restore target backup resource
name'
type: string
required:
- backup
type: object
status:
description: MantleRestoreStatus defines the observed state of MantleRestore
Expand All @@ -54,16 +56,8 @@ spec:
conditions:
description: '''conditions'' specifies current restore conditions'
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
Expand Down Expand Up @@ -104,12 +98,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/mantle.cybozu.io_mantlebackupconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.4
name: mantlebackupconfigs.mantle.cybozu.io
spec:
group: mantle.cybozu.io
Expand Down
22 changes: 5 additions & 17 deletions config/crd/bases/mantle.cybozu.io_mantlebackups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.4
name: mantlebackups.mantle.cybozu.io
spec:
group: mantle.cybozu.io
Expand Down Expand Up @@ -61,23 +61,16 @@ spec:
type: string
required:
- expire
- pvc
type: object
status:
description: MantleBackupStatus defines the observed state of MantleBackup
properties:
conditions:
description: '''conditions'' specifies current backup conditions'
items:
description: "Condition contains details for one aspect of the current
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
Expand Down Expand Up @@ -118,12 +111,7 @@ spec:
- Unknown
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
Loading

0 comments on commit f6d369a

Please sign in to comment.