Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare Release: v2.14.1 #6004

Merged
merged 15 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 19 additions & 33 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM golang:1.21.9
FROM golang:1.21.12

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -16,41 +16,32 @@ ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ENV GO111MODULE=auto

# Configure apt, install packages and tools
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog unzip 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git iproute2 procps lsb-release \
#
# Install gocode-gomod
&& go get -x -d github.com/stamblerre/gocode 2>&1 \
&& go build -o gocode-gomod github.com/stamblerre/gocode \
&& mv gocode-gomod $GOPATH/bin/ \
#
# Install Go tools
&& go get -u -v \
github.com/mdempsky/gocode \
github.com/uudashr/gopkgs/cmd/gopkgs \
github.com/ramya-rao-a/go-outline \
github.com/acroca/go-symbols \
github.com/godoctor/godoctor \
golang.org/x/tools/cmd/gorename \
github.com/rogpeppe/godef \
github.com/zmb3/gogetdoc \
github.com/haya14busa/goplay/cmd/goplay \
github.com/sqs/goreturns \
github.com/josharian/impl \
github.com/davidrjenni/reftools/cmd/fillstruct \
github.com/fatih/gomodifytags \
github.com/cweill/gotests/... \
golang.org/x/tools/cmd/goimports \
golang.org/x/lint/golint \
github.com/alecthomas/gometalinter 2>&1 \
github.com/mgechev/revive \
github.com/derekparker/delve/cmd/dlv 2>&1 \
&& go install github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest \
&& go install github.com/ramya-rao-a/go-outline@latest \
&& go install github.com/acroca/go-symbols@latest \
&& go install github.com/godoctor/godoctor@latest \
&& go install golang.org/x/tools/cmd/gorename@latest \
&& go install github.com/rogpeppe/godef@latest \
&& go install github.com/zmb3/gogetdoc@latest \
&& go install github.com/haya14busa/goplay/cmd/goplay@latest \
&& go install github.com/sqs/goreturns@latest \
&& go install github.com/josharian/impl@latest \
&& go install github.com/davidrjenni/reftools/cmd/fillstruct@latest \
&& go install github.com/fatih/gomodifytags@latest \
&& go install github.com/cweill/gotests/...@latest \
&& go install golang.org/x/tools/cmd/goimports@latest \
&& go install golang.org/x/lint/golint@latest \
&& go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest \
&& go install github.com/mgechev/revive@latest \
&& go install github.com/go-delve/delve/cmd/dlv@latest \
&& go install honnef.co/go/tools/cmd/staticcheck@latest \
&& go install golang.org/x/tools/gopls@latest \
# Protocol Buffer Compiler
Expand All @@ -61,8 +52,6 @@ RUN apt-get update \
&& mv $HOME/.local/bin/protoc /usr/local/bin/protoc \
&& mv $HOME/.local/include/ /usr/local/bin/include/ \
&& protoc --version \
# Install golangci-lint
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 \
#
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
&& groupadd --gid $USER_GID $USERNAME \
Expand Down Expand Up @@ -91,9 +80,6 @@ RUN apt-get update \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved

# Enable go modules
ENV GO111MODULE=on

ENV OPERATOR_RELEASE_VERSION=v1.26.0
RUN ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) \
&& OS=$(uname | awk '{print tolower($0)}') \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id-token: write # needed for signing the images with GitHub OIDC Token **not production ready**

# keda-tools is built from github.com/test-tools/tools/Dockerfile
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
steps:
- name: Check out code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
needs: triage
runs-on: ubuntu-latest
name: Build images
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
if: needs.triage.outputs.run-e2e == 'true'
steps:
- name: Set status in-progress
Expand All @@ -93,6 +93,42 @@ jobs:
gh pr checkout ${{ needs.triage.outputs.pr_num }}
git checkout ${{ needs.triage.outputs.commit_sha }}

- name: Run regex checks
id: regex-validation
continue-on-error: true
env:
COMMENT_BODY: ${{ github.event.comment.body }}
run: |
MESSAGE="$COMMENT_BODY"
REGEX='/run-e2e (.+)'
if [[ "$MESSAGE" =~ $REGEX ]]
then
export E2E_TEST_REGEX="$(echo ${BASH_REMATCH[1]} | head -1)"
fi
make e2e-regex-check

- name: React to comment with failure
uses: dkershner6/reaction-action@v2
if: steps.regex-validation.outcome != 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: "-1"

- name: Set status failure
uses: LouisBrunner/checks-action@6b626ffbad7cc56fd58627f774b9067e6118af23 # v2
if: steps.regex-validation.outcome != 'success'
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ needs.triage.outputs.commit_sha }}
name: ${{ env.E2E_CHECK_NAME }}
conclusion: failure
details_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

- name: Exit on failure
if: steps.regex-validation.outcome != 'success'
run: exit 1

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -112,7 +148,7 @@ jobs:
needs: [triage, build-test-images]
runs-on: e2e
name: Execute e2e tests
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
if: needs.triage.outputs.run-e2e == 'true'
steps:
- name: Set status in-progress
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
validate:
name: validate - ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
strategy:
matrix:
include:
Expand Down Expand Up @@ -73,9 +73,9 @@ jobs:
validate-dockerfiles:
name: validate-dockerfiles - ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
strategy:
matrix:
matrix:
include:
- runner: ARM64
name: arm64
Expand Down Expand Up @@ -104,9 +104,9 @@ jobs:
validate-dev-container:
name: Validate dev-container - ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
strategy:
matrix:
matrix:
include:
- runner: ARM64
name: arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id-token: write # needed for signing the images with GitHub OIDC Token **not production ready**

# keda-tools is built from github.com/test-tools/tools/Dockerfile
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
steps:
- name: Check out code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
codeQl:
name: Analyze CodeQL Go
runs-on: ubuntu-latest
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
if: (github.actor != 'dependabot[bot]')
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/template-main-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Run e2e test
runs-on: ARM64
# keda-tools is built from github.com/test-tools/tools/Dockerfile
container: ghcr.io/kedacore/keda-tools:1.21.9
container: ghcr.io/kedacore/keda-tools:1.21.12
concurrency: e2e-tests
steps:
- name: Check out code
Expand Down
40 changes: 9 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
## History

- [Unreleased](#unreleased)
- [v2.14.1](#v2141)
- [v2.14.0](#v2140)
- [v2.13.1](#v2131)
- [v2.13.0](#v2130)
Expand Down Expand Up @@ -50,41 +51,18 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
- [v1.1.0](#v110)
- [v1.0.0](#v100)

## Unreleased

### New

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

#### Experimental

Here is an overview of all new **experimental** features:

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

### Improvements

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))
## v2.14.1

### Fixes

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

### Deprecations

You can find all deprecations in [this overview](https://github.com/kedacore/keda/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abreaking-change) and [join the discussion here](https://github.com/kedacore/keda/discussions/categories/deprecations).

New deprecation(s):

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

### Breaking Changes

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

### Other
- **General**: Do not delete running Jobs on KEDA restart ([#5656](https://github.com/kedacore/keda/issues/5656))
- **General**: Fix CVE-2024-24790, CVE-2024-24789, and CVE-2024-24791 in stdlib. ([#5971](https://github.com/kedacore/keda/pull/5971))
- **General**: Fix CVE-2024-35255 in github.com/Azure/azure-sdk-for-go/sdk/azidentity ([#5971](https://github.com/kedacore/keda/pull/5971))
- **General**: Fix CVE-2024-6104 in github.com/hashicorp/go-retryablehttp ([#5971](https://github.com/kedacore/keda/pull/5971))
- **General**: Fix ScaledJob ignores failing trigger(s) error ([#5922](https://github.com/kedacore/keda/issues/5922))- **General**: Scalers are properly closed after being refreshed ([#5806](https://github.com/kedacore/keda/issues/5806))
- **GitHub Scaler**: Fixed pagination, fetching repository list ([#5738](https://github.com/kedacore/keda/issues/5738))
- **MongoDB Scaler**: MongoDB url parses correctly `+srv` scheme ([#5760](https://github.com/kedacore/keda/issues/5760))

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))

## v2.14.0

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 --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.9 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.12 AS builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.adapter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the adapter binary
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.9 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.12 AS builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhooks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.9 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.21.12 AS builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ scale-node-pool: az-login ## Scale nodepool.
--resource-group $(TF_AZURE_RESOURCE_GROUP) \
--node-count $(NODE_POOL_SIZE)

.PHONY: e2e-regex-check
e2e-regex-check:
go run -tags e2e ./tests/run-all.go regex-check

.PHONY: e2e-test
e2e-test: get-cluster-context ## Run e2e tests against Azure cluster.
TERMINFO=/etc/terminfo
Expand Down Expand Up @@ -268,15 +272,15 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
deploy: install ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && \
$(KUSTOMIZE) edit set image ghcr.io/kedacore/keda=${IMAGE_CONTROLLER} && \
if [ "$(AZURE_RUN_AAD_POD_IDENTITY_TESTS)" = true ]; then \
if [ "$(AZURE_RUN_WORKLOAD_IDENTITY_TESTS)" = true ]; then \
$(KUSTOMIZE) edit add label --force aadpodidbinding:keda; \
fi && \
if [ "$(AZURE_RUN_WORKLOAD_IDENTITY_TESTS)" = true ]; then \
$(KUSTOMIZE) edit add label --force azure.workload.identity/use:true; \
fi
cd config/metrics-server && \
$(KUSTOMIZE) edit set image ghcr.io/kedacore/keda-metrics-apiserver=${IMAGE_ADAPTER} && \
if [ "$(AZURE_RUN_AAD_POD_IDENTITY_TESTS)" = true ]; then \
if [ "$(AZURE_RUN_WORKLOAD_IDENTITY_TESTS)" = true ]; then \
$(KUSTOMIZE) edit add label --force aadpodidbinding:keda; \
fi
if [ "$(AZURE_RUN_WORKLOAD_IDENTITY_TESTS)" = true ]; then \
Expand Down
38 changes: 26 additions & 12 deletions controllers/keda/scaledjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,36 @@ func (r *ScaledJobReconciler) deletePreviousVersionScaleJobs(ctx context.Context
return "Cannot get list of Jobs owned by this scaledJob", err
}

if len(jobs.Items) > 0 {
logger.Info("RolloutStrategy: immediate, Deleting jobs owned by the previous version of the scaledJob", "numJobsToDelete", len(jobs.Items))
jobIndexes := make([]int, 0, len(jobs.Items))
scaledJobGeneration := strconv.FormatInt(scaledJob.Generation, 10)
for i, job := range jobs.Items {
if jobGen, ok := job.Annotations["scaledjob.keda.sh/generation"]; !ok {
// delete Jobs that don't have the generation annotation
jobIndexes = append(jobIndexes, i)
} else if jobGen != scaledJobGeneration {
// delete Jobs that have a different generation annotation
jobIndexes = append(jobIndexes, i)
}
}
for _, job := range jobs.Items {
job := job

propagationPolicy := metav1.DeletePropagationBackground
if scaledJob.Spec.Rollout.PropagationPolicy == "foreground" {
propagationPolicy = metav1.DeletePropagationForeground
}
err = r.Client.Delete(ctx, &job, client.PropagationPolicy(propagationPolicy))
if err != nil {
return "Not able to delete job: " + job.Name, err
if len(jobIndexes) == 0 {
logger.Info("RolloutStrategy: immediate, No jobs owned by the previous version of the scaledJob")
} else {
logger.Info("RolloutStrategy: immediate, Deleting jobs owned by the previous version of the scaledJob", "numJobsToDelete", len(jobIndexes))
for _, index := range jobIndexes {
job := jobs.Items[index]

propagationPolicy := metav1.DeletePropagationBackground
if scaledJob.Spec.Rollout.PropagationPolicy == "foreground" {
propagationPolicy = metav1.DeletePropagationForeground
}
err = r.Client.Delete(ctx, &job, client.PropagationPolicy(propagationPolicy))
if err != nil {
return "Not able to delete job: " + job.Name, err
}
}
return fmt.Sprintf("RolloutStrategy: immediate, deleted jobs owned by the previous version of the scaleJob: %d jobs deleted", len(jobIndexes)), nil
}
return fmt.Sprintf("RolloutStrategy: immediate, deleted jobs owned by the previous version of the scaleJob: %d jobs deleted", len(jobs.Items)), nil
}
return fmt.Sprintf("RolloutStrategy: %s", scaledJob.Spec.RolloutStrategy), nil
}
Expand Down
Loading
Loading