From 23f1e97f4e358b825d12c0c23c8e84f6659d9fba Mon Sep 17 00:00:00 2001 From: berg Date: Fri, 27 Oct 2023 11:56:48 +0800 Subject: [PATCH] add changelog v0.4.0 (#160) * add changelog v0.4.0 Signed-off-by: liheng.zms * optimize webhook patchResponse function Signed-off-by: liheng.zms * modify makefile install helm Signed-off-by: liheng.zms * modify github workflow golang version 1.19 Signed-off-by: liheng.zms * modify makefile kustomize version v4.5.5 Signed-off-by: liheng.zms * go format Signed-off-by: liheng.zms --------- Signed-off-by: liheng.zms --- .github/workflows/ci.yaml | 2 +- .../e2e-advanced-deployment-1.19.yaml | 2 +- .../e2e-advanced-deployment-1.23.yaml | 2 +- .github/workflows/e2e-cloneset-1.19.yaml | 2 +- .github/workflows/e2e-cloneset-1.23.yaml | 2 +- .github/workflows/e2e-daemonset-1.19.yaml | 2 +- .github/workflows/e2e-daemonset-1.23.yaml | 2 +- .github/workflows/e2e-deployment-1.19.yaml | 2 +- .github/workflows/e2e-deployment-1.23.yaml | 2 +- .github/workflows/e2e-gateway.yaml | 2 +- .github/workflows/e2e-others-1.19.yaml | 2 +- .github/workflows/e2e-others-1.23.yaml | 2 +- .github/workflows/e2e-statefulset-1.19.yaml | 2 +- .github/workflows/e2e-statefulset-1.23.yaml | 2 +- CHANGELOG.md | 15 +++++ Makefile | 6 +- .../util/writer/atomic/atomic_writer.go | 63 +++++++++++-------- 17 files changed, 68 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f30581c0..3d6c1a6b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' GOLANGCI_VERSION: 'v1.42' jobs: diff --git a/.github/workflows/e2e-advanced-deployment-1.19.yaml b/.github/workflows/e2e-advanced-deployment-1.19.yaml index bc5285d3..1b04da6e 100644 --- a/.github/workflows/e2e-advanced-deployment-1.19.yaml +++ b/.github/workflows/e2e-advanced-deployment-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-advanced-deployment-1.23.yaml b/.github/workflows/e2e-advanced-deployment-1.23.yaml index 581605f7..10edb25e 100644 --- a/.github/workflows/e2e-advanced-deployment-1.23.yaml +++ b/.github/workflows/e2e-advanced-deployment-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-cloneset-1.19.yaml b/.github/workflows/e2e-cloneset-1.19.yaml index 9b45ec68..04e0a8eb 100644 --- a/.github/workflows/e2e-cloneset-1.19.yaml +++ b/.github/workflows/e2e-cloneset-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-cloneset-1.23.yaml b/.github/workflows/e2e-cloneset-1.23.yaml index 92979c5f..2bc0b0c2 100644 --- a/.github/workflows/e2e-cloneset-1.23.yaml +++ b/.github/workflows/e2e-cloneset-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-daemonset-1.19.yaml b/.github/workflows/e2e-daemonset-1.19.yaml index 6767621b..15c868d3 100644 --- a/.github/workflows/e2e-daemonset-1.19.yaml +++ b/.github/workflows/e2e-daemonset-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-daemonset-1.23.yaml b/.github/workflows/e2e-daemonset-1.23.yaml index bfff666a..75ee88f2 100644 --- a/.github/workflows/e2e-daemonset-1.23.yaml +++ b/.github/workflows/e2e-daemonset-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-deployment-1.19.yaml b/.github/workflows/e2e-deployment-1.19.yaml index 22e7f606..c67f45bd 100644 --- a/.github/workflows/e2e-deployment-1.19.yaml +++ b/.github/workflows/e2e-deployment-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-deployment-1.23.yaml b/.github/workflows/e2e-deployment-1.23.yaml index 438e36b9..59ffe444 100644 --- a/.github/workflows/e2e-deployment-1.23.yaml +++ b/.github/workflows/e2e-deployment-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-gateway.yaml b/.github/workflows/e2e-gateway.yaml index c54a8de9..457ff5f3 100644 --- a/.github/workflows/e2e-gateway.yaml +++ b/.github/workflows/e2e-gateway.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-others-1.19.yaml b/.github/workflows/e2e-others-1.19.yaml index f459dfce..8caa8c9f 100644 --- a/.github/workflows/e2e-others-1.19.yaml +++ b/.github/workflows/e2e-others-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-others-1.23.yaml b/.github/workflows/e2e-others-1.23.yaml index 446390ff..6fbfdab5 100644 --- a/.github/workflows/e2e-others-1.23.yaml +++ b/.github/workflows/e2e-others-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-statefulset-1.19.yaml b/.github/workflows/e2e-statefulset-1.19.yaml index c02eeecf..571c82e0 100644 --- a/.github/workflows/e2e-statefulset-1.19.yaml +++ b/.github/workflows/e2e-statefulset-1.19.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.19.16' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/.github/workflows/e2e-statefulset-1.23.yaml b/.github/workflows/e2e-statefulset-1.23.yaml index 1d7ec589..7045b962 100644 --- a/.github/workflows/e2e-statefulset-1.23.yaml +++ b/.github/workflows/e2e-statefulset-1.23.yaml @@ -10,7 +10,7 @@ on: env: # Common versions - GO_VERSION: '1.17' + GO_VERSION: '1.19' KIND_IMAGE: 'kindest/node:v1.23.3' KIND_CLUSTER_NAME: 'ci-testing' diff --git a/CHANGELOG.md b/CHANGELOG.md index b5b991b7..bec3c6ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## v0.4.0 +### Kruise-Rollout-Controller +- Rollout Support Kruise Advanced DaemonSet. ([#134](https://github.com/openkruise/rollouts/pull/134), [@Yadan-Wei](https://github.com/Yadan-Wei)) +- Rollout support end-to-end canary deployment. ([#153](https://github.com/openkruise/rollouts/pull/153), [@zmberg](https://github.com/zmberg)) +- Rollout trafficTouting support requestHeaderModifier. ([#156](https://github.com/openkruise/rollouts/pull/156), [@zmberg](https://github.com/zmberg)) +- Rollout support disabled for a rollout. ([#155](https://github.com/openkruise/rollouts/pull/155), [@Kuromesi](https://github.com/Kuromesi)) +- Rollout support patch PodTemplateMetadata. ([#157](https://github.com/openkruise/rollouts/pull/157), [@zmberg](https://github.com/zmberg)) +- Rollout only webhook workload which has rollout CR. ([#158](https://github.com/openkruise/rollouts/pull/158), [@zmberg](https://github.com/zmberg)) +- Advanced deployment scale down old unhealthy pods firstly. ([#150](https://github.com/openkruise/rollouts/pull/150), [@veophi](https://github.com/veophi)) +- Update k8s registry references to registry.k8s.io. ([#126](https://github.com/openkruise/rollouts/pull/126), [@asa3311](https://github.com/asa3311)) +- When the data type of spec.replicas is int, cancel the upper 100 limit. ([#142](https://github.com/openkruise/rollouts/pull/142), [@MrSumeng](https://github.com/MrSumeng)) +- Add e2e test for advanced daemonSet. ([#143](https://github.com/openkruise/rollouts/pull/143), [@Janice1457](https://github.com/Janice1457)) +- Exclude workload deleted matching labels in webhook. ([#146](https://github.com/openkruise/rollouts/pull/146), [@wangyikewxgm](https://github.com/wangyikewxgm)) +- Optimize the modification of rollout to GatewayAPI httpRoute header. ([#137](https://github.com/openkruise/rollouts/pull/137), [@ZhangSetSail](https://github.com/ZhangSetSail)) + ## v0.3.0 ### Kruise-Rollout-Controller diff --git a/Makefile b/Makefile index 69312295..87dac730 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ endif KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) + $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5) GINKGO = $(shell pwd)/bin/ginkgo ginkgo: ## Download ginkgo locally if necessary. @@ -108,7 +108,7 @@ ginkgo: ## Download ginkgo locally if necessary. HELM = $(shell pwd)/bin/helm helm: ## Download helm locally if necessary. - $(call go-get-tool,$(HELM),helm.sh/helm/v3@v3.8.1) + $(call go-get-tool,$(HELM),helm.sh/helm/v3/cmd/helm@latest) # go-get-tool will 'go get' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) @@ -119,7 +119,7 @@ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ rm -rf $$TMP_DIR ;\ } endef diff --git a/pkg/webhook/util/writer/atomic/atomic_writer.go b/pkg/webhook/util/writer/atomic/atomic_writer.go index e8649283..21323e2b 100644 --- a/pkg/webhook/util/writer/atomic/atomic_writer.go +++ b/pkg/webhook/util/writer/atomic/atomic_writer.go @@ -42,9 +42,9 @@ const ( // // Note: // -// 1. Writer reserves the set of pathnames starting with `..`. -// 2. Writer offers no concurrency guarantees and must be synchronized -// by the caller. +// 1. Writer reserves the set of pathnames starting with `..`. +// 2. Writer offers no concurrency guarantees and must be synchronized +// by the caller. // // The visible files in this volume are symlinks to files in the writer's data // directory. Actual files are stored in a hidden timestamped directory which @@ -86,33 +86,42 @@ const ( // // The Write algorithm is: // -// 1. The payload is validated; if the payload is invalid, the function returns -// 2. The current timestamped directory is detected by reading the data directory -// symlink -// 3. The old version of the volume is walked to determine whether any -// portion of the payload was deleted and is still present on disk. -// 4. The data in the current timestamped directory is compared to the projected -// data to determine if an update is required. -// 5. A new timestamped dir is created -// 6. The payload is written to the new timestamped directory -// 7. Symlinks and directory for new user-visible files are created (if needed). +// 1. The payload is validated; if the payload is invalid, the function returns // -// For example, consider the files: -// /podName -// /user/labels -// /k8s/annotations +// 2. The current timestamped directory is detected by reading the data directory +// symlink // -// The user visible files are symbolic links into the internal data directory: -// /podName -> ..data/podName -// /usr -> ..data/usr -// /k8s -> ..data/k8s +// 3. The old version of the volume is walked to determine whether any +// portion of the payload was deleted and is still present on disk. +// +// 4. The data in the current timestamped directory is compared to the projected +// data to determine if an update is required. +// +// 5. A new timestamped dir is created +// +// 6. The payload is written to the new timestamped directory +// +// 7. Symlinks and directory for new user-visible files are created (if needed). +// +// For example, consider the files: +// /podName +// /user/labels +// /k8s/annotations +// +// The user visible files are symbolic links into the internal data directory: +// /podName -> ..data/podName +// /usr -> ..data/usr +// /k8s -> ..data/k8s +// +// The data directory itself is a link to a timestamped directory with +// the real data: +// /..data -> ..2016_02_01_15_04_05.12345678/ +// +// 8. A symlink to the new timestamped directory ..data_tmp is created that will +// become the new data directory +// +// 9. The new data directory symlink is renamed to the data directory; rename is atomic // -// The data directory itself is a link to a timestamped directory with -// the real data: -// /..data -> ..2016_02_01_15_04_05.12345678/ -// 8. A symlink to the new timestamped directory ..data_tmp is created that will -// become the new data directory -// 9. The new data directory symlink is renamed to the data directory; rename is atomic // 10. Old paths are removed from the user-visible portion of the target directory // 11. The previous timestamped directory is removed, if it exists func (w *Writer) Write(payload map[string]FileProjection) error {