-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from phantomnat/feat/update-k8s
Chore: update k8s to 1.29
- Loading branch information
Showing
12 changed files
with
4,152 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,9 @@ on: | |
|
||
env: | ||
# Common versions | ||
GO_VERSION: '1.20' | ||
GOLANGCI_VERSION: 'v1.49' | ||
KIND_VERSION: 'v0.19.0' | ||
GO_VERSION: '1.22' | ||
GOLANGCI_VERSION: 'v1.56' | ||
KIND_VERSION: 'v0.23.0' | ||
|
||
jobs: | ||
|
||
|
@@ -54,9 +54,9 @@ jobs: | |
- name: install Kubebuilder | ||
uses: RyanSiu1995/[email protected] | ||
with: | ||
version: 3.1.0 | ||
version: 3.15.1 | ||
kubebuilderOnly: false | ||
kubernetesVersion: v1.22.0 | ||
kubernetesVersion: v1.29.0 | ||
- name: Run Make test | ||
run: make test | ||
- name: Upload coverage report | ||
|
@@ -93,6 +93,9 @@ jobs: | |
restore-keys: ${{ runner.os }}-pkg- | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
version: v0.24.0 | ||
node_image: kindest/node:v1.29.8 | ||
- name: Build Image | ||
run: | | ||
make image | ||
|
@@ -135,6 +138,9 @@ jobs: | |
run: curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bash | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
version: v0.24.0 | ||
node_image: kindest/node:v1.29.8 | ||
- name: Prepare OCM testing environment | ||
run: | | ||
clusteradm init --output-join-command-file join.sh --wait | ||
|
@@ -152,6 +158,8 @@ jobs: | |
cluster-gateway ./charts/addon-manager \ | ||
--set tag=latest | ||
go run ./e2e/env/prepare | kubectl apply -f - | ||
kubectl rollout status deployment -n vela-system gateway-deployment --timeout 1m | ||
kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev | ||
- name: Run e2e test | ||
run: | | ||
make test-e2e-ocm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
IMG ?= controller:latest | ||
IMG_TAG ?= latest | ||
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion) | ||
CRD_OPTIONS ?= "crd:trivialVersions=true" | ||
CRD_OPTIONS ?= "crd" | ||
|
||
OS?=linux | ||
ARCH?=amd64 | ||
|
@@ -20,15 +20,15 @@ VERSION=v0.0.21 | |
all: manager | ||
|
||
# Run tests | ||
test: generate fmt vet manifests | ||
test: generate generate-openapi fmt vet manifests | ||
go test ./pkg/... -coverprofile cover.out | ||
|
||
# Build manager binary | ||
manager: generate fmt vet | ||
manager: generate generate-openapi fmt vet | ||
go build -o bin/manager ./cmd/apiserver/main.go | ||
|
||
# Run against the configured Kubernetes cluster in ~/.kube/config | ||
run: generate fmt vet manifests | ||
run: generate generate-openapi fmt vet manifests | ||
go run ./cmd/apiserver/main.go | ||
|
||
local-run: | ||
|
@@ -76,14 +76,29 @@ ifeq (, $(shell which controller-gen)) | |
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ | ||
cd $$CONTROLLER_GEN_TMP_DIR ;\ | ||
go mod init tmp ;\ | ||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\ | ||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 ;\ | ||
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ | ||
} | ||
CONTROLLER_GEN=$(GOBIN)/controller-gen | ||
else | ||
CONTROLLER_GEN=$(shell which controller-gen) | ||
endif | ||
|
||
openapi-gen: | ||
ifeq (, $(shell which openapi-gen)) | ||
@{ \ | ||
set -e ;\ | ||
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ | ||
cd $$CONTROLLER_GEN_TMP_DIR ;\ | ||
go mod init tmp ;\ | ||
go install k8s.io/kube-openapi/cmd/[email protected] ;\ | ||
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ | ||
} | ||
OPENAPI_GEN=$(GOBIN)/openapi-gen | ||
else | ||
OPENAPI_GEN=$(shell which openapi-gen) | ||
endif | ||
|
||
kustomize: | ||
ifeq (, $(shell which kustomize)) | ||
@{ \ | ||
|
@@ -100,7 +115,7 @@ KUSTOMIZE=$(shell which kustomize) | |
endif | ||
|
||
client-gen: | ||
go install k8s.io/code-generator/cmd/client-gen@v0.21.2 | ||
go install k8s.io/code-generator/cmd/client-gen@v0.29.2 | ||
apiserver-runtime-gen \ | ||
--module github.com/oam-dev/cluster-gateway \ | ||
-g client-gen \ | ||
|
@@ -111,6 +126,21 @@ client-gen: | |
generate: controller-gen | ||
${CONTROLLER_GEN} object:headerFile="hack/boilerplate.go.txt" paths="./pkg/apis/proxy/..." | ||
|
||
.PHONY: generate-openapi | ||
generate-openapi: openapi-gen | ||
${OPENAPI_GEN} \ | ||
--output-pkg github.com/oam-dev/cluster-gateway/pkg/apis \ | ||
--output-file zz_generated.openapi.go \ | ||
--output-dir ./pkg/apis/generated \ | ||
--output-pkg "generated" \ | ||
--go-header-file ./hack/boilerplate.go.txt \ | ||
./pkg/apis/proxy/v1alpha1 \ | ||
./pkg/apis/cluster/v1alpha1 \ | ||
k8s.io/apimachinery/pkg/api/resource \ | ||
k8s.io/apimachinery/pkg/apis/meta/v1 \ | ||
k8s.io/apimachinery/pkg/runtime \ | ||
k8s.io/apimachinery/pkg/version | ||
|
||
manifests: controller-gen | ||
${CONTROLLER_GEN} $(CRD_OPTIONS) \ | ||
paths="./pkg/apis/proxy/..." \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.