Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #46 from everpeace/upgrade-v1.24.3
Browse files Browse the repository at this point in the history
Upgrade Kubernetes v1.24.3 (go 1.18)
  • Loading branch information
everpeace committed Aug 17, 2022
2 parents 4d4f278 + ad9c1e8 commit c299a59
Show file tree
Hide file tree
Showing 18 changed files with 347 additions and 293 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: ~1.18
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: ~1.18
id: go
- name: Check out
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
go-version: ~1.18
id: go
- name: Check out
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 as builder
FROM golang:1.18 as builder
ARG RELEASE
ARG VERSION
WORKDIR /workspace
Expand Down
39 changes: 17 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ generate: codegen crd

.PHONY: codegen
codegen:
./hack/update-codegen.sh
CODEGEN_PKG=$(CODEGEN_PKG) ./hack/update-codegen.sh
$(GO_LICENSER) --licensor "Shingo Omura"

.PHONY: crd
Expand Down Expand Up @@ -97,29 +97,24 @@ GOLANGCI_LINT = $(DEV_TOOL_PREFIX)/bin/golangci-lint
GO_LICENSER = $(DEV_TOOL_PREFIX)/bin/go-licenser
GO_IMPORTS = $(DEV_TOOL_PREFIX)/bin/goimports
CONTROLLER_GEN = $(DEV_TOOL_PREFIX)/bin/controller-gen
CODEGEN_PKG=$(CODEGEN_PKG_NAME)@$(CODEGEN_PKG_VERSION)
CODEGEN_PKG_NAME=k8s.io/code-generator
CODEGEN_PKG_VERSION=v0.24.3
KIND = $(DEV_TOOL_PREFIX)/bin/kind
KIND_KUBECNOFIG = $(DEV_TOOL_PREFIX)/.kubeconfig
setup:
$(call go-get-tool,$(GO_IMPORTS),golang.org/x/tools/cmd/goimports)
$(call go-get-tool,$(GO_LICENSER),github.com/elastic/go-licenser)
$(call go-get-tool,$(GIT_SEMV),github.com/linyows/git-semv/cmd/git-semv)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
$(call go-get-tool,$(KIND),sigs.k8s.io/kind)
cd $(shell go env GOPATH) && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(DEV_TOOL_PREFIX)/bin v1.43.0

# go-get-tool will 'go get' any package $2 and install it to $1.
define go-get-tool
@[ -f $(1) ] || { \
set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(DEV_TOOL_PREFIX)/bin go get $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef
GOBIN=$(DEV_TOOL_PREFIX)/bin go install golang.org/x/tools/cmd/goimports@latest
GOBIN=$(DEV_TOOL_PREFIX)/bin go install github.com/elastic/go-licenser@latest
GOBIN=$(DEV_TOOL_PREFIX)/bin go install github.com/linyows/git-semv/cmd/git-semv@latest
GOBIN=$(DEV_TOOL_PREFIX)/bin go install sigs.k8s.io/controller-tools/cmd/[email protected]
go mod download $(CODEGEN_PKG)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install $(CODEGEN_PKG_NAME)/cmd/defaulter-gen@$(CODEGEN_PKG_VERSION)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install $(CODEGEN_PKG_NAME)/cmd/client-gen@$(CODEGEN_PKG_VERSION)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install $(CODEGEN_PKG_NAME)/cmd/lister-gen@$(CODEGEN_PKG_VERSION)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install $(CODEGEN_PKG_NAME)/cmd/informer-gen@$(CODEGEN_PKG_VERSION)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install $(CODEGEN_PKG_NAME)/cmd/deepcopy-gen@$(CODEGEN_PKG_VERSION)
GOBIN=$(DEV_TOOL_PREFIX)/bin go install sigs.k8s.io/kind@latest
GOBIN=$(DEV_TOOL_PREFIX)/bin go install github.com/golangci/golangci-lint/cmd/[email protected]

#
# local development
Expand Down Expand Up @@ -158,7 +153,7 @@ export E2E_GOMEGA_DEFAULT_CONSISTENTLY_DURATION=2s
E2E_PAUSE_IMAGE=k8s.gcr.io/pause:3.2
E2E_KIND_KUBECNOFIG = $(DEV_TOOL_PREFIX)/.kubeconfig
E2E_KIND_CONF=./hack/e2e/kind.conf
E2E_NODE_IMAGE ?= kindest/node:v1.23.4
E2E_NODE_IMAGE ?= kindest/node:v1.24.3
e2e-setup:
$(KIND) get clusters | grep kube-throttler-e2e 2>&1 >/dev/null \
|| $(KIND) create cluster --name=kube-throttler-e2e \
Expand Down
128 changes: 64 additions & 64 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
creationTimestamp: null
name: throttles.schedule.k8s.everpeace.github.com
name: clusterthrottles.schedule.k8s.everpeace.github.com
spec:
group: schedule.k8s.everpeace.github.com
names:
categories:
- kube-throttler
kind: Throttle
listKind: ThrottleList
plural: throttles
kind: ClusterThrottle
listKind: ClusterThrottleList
plural: clusterthrottles
shortNames:
- thr
- thrs
singular: throttle
scope: Namespaced
- clthr
- clthrs
singular: clusterthrottle
scope: Cluster
versions:
- additionalPrinterColumns:
- format: byte
Expand Down Expand Up @@ -59,6 +59,54 @@ spec:
selectorTerms:
items:
properties:
namespaceSelector:
description: A label selector is a label query over a set
of resources. The result of matchLabels and matchExpressions
are ANDed. An empty label selector matches all objects.
A null label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
podSelector:
description: A label selector is a label query over a set
of resources. The result of matchLabels and matchExpressions
Expand Down Expand Up @@ -251,20 +299,20 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
creationTimestamp: null
name: clusterthrottles.schedule.k8s.everpeace.github.com
name: throttles.schedule.k8s.everpeace.github.com
spec:
group: schedule.k8s.everpeace.github.com
names:
categories:
- kube-throttler
kind: ClusterThrottle
listKind: ClusterThrottleList
plural: clusterthrottles
kind: Throttle
listKind: ThrottleList
plural: throttles
shortNames:
- clthr
- clthrs
singular: clusterthrottle
scope: Cluster
- thr
- thrs
singular: throttle
scope: Namespaced
versions:
- additionalPrinterColumns:
- format: byte
Expand Down Expand Up @@ -304,54 +352,6 @@ spec:
selectorTerms:
items:
properties:
namespaceSelector:
description: A label selector is a label query over a set
of resources. The result of matchLabels and matchExpressions
are ANDed. An empty label selector matches all objects.
A null label selector matches no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
podSelector:
description: A label selector is a label query over a set
of resources. The result of matchLabels and matchExpressions
Expand Down
Loading

0 comments on commit c299a59

Please sign in to comment.