Skip to content

Commit

Permalink
Merge pull request #19 from cybozu-go/k8s-1.24
Browse files Browse the repository at this point in the history
Support Kubernetes 1.24
  • Loading branch information
kmdkuk authored Nov 16, 2022
2 parents ef7cb67 + 4e5946f commit 624427e
Show file tree
Hide file tree
Showing 16 changed files with 249 additions and 183 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- 'main'
env:
go-version: 1.17
go-version: 1.19
cache-version: 1
jobs:
build:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
name: End-to-End Tests
strategy:
matrix:
k8s-version: ["1.22.4", "1.23.1"]
k8s-version: ["1.22.15", "1.23.13", "1.24.7"]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- 'v*'
env:
go-version: 1.17
go-version: 1.19
jobs:
release:
runs-on: ubuntu-20.04
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- Support Kubernetes 1.24 ([#19](https://github.com/cybozu-go/cattage/pull/19))
- Build with go 1.18
- Update dependencies

## [0.1.2] - 2022-04-06

### Fixed
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tool versions
CTRL_RUNTIME_VERSION := $(shell awk '/sigs.k8s.io\/controller-runtime/ {print substr($$2, 2)}' go.mod)
ARGOCD_VERSION = 2.3.2
ARGOCD_VERSION = 2.3.9

# Test tools
BIN_DIR := $(shell pwd)/bin
Expand Down Expand Up @@ -86,7 +86,6 @@ test: test-tools
go vet ./...
test -z $$(gofmt -s -l . | tee /dev/stderr)
$(STATICCHECK) ./...
$(NILERR) ./...

.PHONY: container-structure-test
container-structure-test:
Expand Down Expand Up @@ -143,12 +142,8 @@ setup-envtest: ## Download setup-envtest locally if necessary
GOBIN=$(BIN_DIR) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: test-tools
test-tools: $(STATICCHECK) $(NILERR)
test-tools: $(STATICCHECK)

$(STATICCHECK):
mkdir -p $(BIN_DIR)
GOBIN=$(BIN_DIR) go install honnef.co/go/tools/cmd/staticcheck@latest

$(NILERR):
mkdir -p $(BIN_DIR)
GOBIN=$(BIN_DIR) go install github.com/gostaticanalysis/nilerr/cmd/nilerr@latest
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ Cattage depends on the specification of Argo CD and Accurate.

Cattage supports the following versions:

| Cattage | Argo CD | Accurate |
|---------|---------|----------|
| 0.1.x | 2.2.5 | 0.3.x |
| Cattage | Argo CD | Accurate |
| ------------ | ------- | -------- |
| 0.1.3 | 2.3.9 | 0.4.x |
| 0.1.2 | 2.3.2 | 0.3.x |
| 0.1.0, 0.1.1 | 2.2.5 | 0.3.x |

## Documentation

Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package v1beta1 contains API Schema definitions for the cattage v1beta1 API group
//+kubebuilder:object:generate=true
//+groupName=cattage.cybozu.io
// +kubebuilder:object:generate=true
// +groupName=cattage.cybozu.io
package v1beta1

import (
Expand Down
14 changes: 5 additions & 9 deletions aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
# https://aquaproj.github.io/
registries:
- type: standard
ref: v1.10.0 # renovate: depName=aquaproj/aqua-registry
- type: local
name: local
path: registry.yaml
ref: v3.94.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: argoproj/[email protected].2
- name: kubernetes/kubectl@v1.23.5
- name: argoproj/[email protected].9
- name: kubernetes/kubectl@v1.24.7
- name: kubernetes-sigs/[email protected]
- name: kubernetes-sigs/kustomize@kustomize/v4.5.3
- name: kubernetes-sigs/kind@v0.12.0
- name: kubernetes-sigs/kind@v0.17.0
- name: rust-lang/[email protected]
- name: tilt-dev/[email protected]
- name: tilt-dev/ctlptl@v0.7.6
- name: tilt-dev/ctlptl@v0.8.12
- name: GoogleContainerTools/[email protected]
- name: mikefarah/[email protected]
- name: clamoriniere/[email protected]
registry: local
2 changes: 1 addition & 1 deletion charts/cattage/crds/tenant.yaml
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.8.0
controller-gen.kubebuilder.io/version: v0.9.2
labels:
app.kubernetes.io/name: cattage
name: tenants.cattage.cybozu.io
Expand Down
2 changes: 1 addition & 1 deletion cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ apiVersion: ctlptl.dev/v1alpha1
kind: Cluster
name: kind-cattage-dev
product: kind
kubernetesVersion: v1.23.4
kubernetesVersion: v1.24.7
registry: ctlptl-registry
8 changes: 1 addition & 7 deletions config/crd/bases/cattage.cybozu.io_tenants.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.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: tenants.cattage.cybozu.io
spec:
Expand Down Expand Up @@ -183,9 +183,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
4 changes: 2 additions & 2 deletions controllers/application_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (r *ApplicationReconciler) syncApplicationSpec(ctx context.Context, argocdA
}

err := r.client.Patch(ctx, newApp, client.Apply, &client.PatchOptions{
Force: pointer.BoolPtr(true),
Force: pointer.Bool(true),
FieldManager: constants.SpecFieldManager,
})
if err != nil {
Expand Down Expand Up @@ -346,7 +346,7 @@ func (r *ApplicationReconciler) syncApplicationStatus(ctx context.Context, argoc

// MEMO: Use `r.Patch` instead of `r.Status().Patch()`, because the status of application is not a sub-resource.
err = r.client.Patch(ctx, newApp, client.Apply, &client.PatchOptions{
Force: pointer.BoolPtr(true),
Force: pointer.Bool(true),
FieldManager: constants.StatusFieldManager,
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion controllers/tenant_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func (r *TenantReconciler) reconcileArgoCD(ctx context.Context, tenant *cattagev
}

err = r.client.Patch(ctx, proj, client.Apply, &client.PatchOptions{
Force: pointer.BoolPtr(true),
Force: pointer.Bool(true),
FieldManager: constants.TenantFieldManager,
})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions e2e/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KUBERNETES_VERSION = 1.23.4
ARGOCD_VERSION = 2.3.2
KUBERNETES_VERSION = 1.24.7
ARGOCD_VERSION = 2.3.9

KIND_CONFIG = kind-config.yaml
export KUBECONFIG
Expand Down Expand Up @@ -48,7 +48,7 @@ logs:
rm -rf logs

.PHONY: stop
stop:
stop:
kind delete cluster --name=cattage
-docker image rm cattage:dev
-docker image prune -f
88 changes: 48 additions & 40 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,88 @@ module github.com/cybozu-go/cattage
go 1.17

require (
github.com/google/go-cmp v0.5.7
github.com/onsi/ginkgo/v2 v2.1.3
github.com/onsi/gomega v1.18.1
github.com/spf13/cobra v1.4.0
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
k8s.io/client-go v0.23.5
k8s.io/klog/v2 v2.60.1
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/controller-runtime v0.11.1
sigs.k8s.io/controller-tools v0.8.0
sigs.k8s.io/structured-merge-diff/v4 v4.2.1
github.com/google/go-cmp v0.5.9
github.com/onsi/ginkgo/v2 v2.5.0
github.com/onsi/gomega v1.24.0
github.com/spf13/cobra v1.6.1
k8s.io/api v0.24.7
k8s.io/apimachinery v0.24.7
k8s.io/client-go v0.24.7
k8s.io/klog/v2 v2.80.1
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2
sigs.k8s.io/controller-runtime v0.12.3
sigs.k8s.io/controller-tools v0.9.2
sigs.k8s.io/structured-merge-diff/v4 v4.2.3
sigs.k8s.io/yaml v1.3.0
)

require (
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/gobuffalo/flect v0.2.3 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/mod v0.5.0 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.24.7 // indirect
k8s.io/component-base v0.24.7 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
)
Loading

0 comments on commit 624427e

Please sign in to comment.