From 9f695ec6f7493a990e80cec7434bb68229f09cd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 11:10:39 +0200 Subject: [PATCH 01/14] Bump golang.org/x/net from 0.19.0 to 0.23.0 in /radix-cluster-cleanup (#45) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.19.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- radix-cluster-cleanup/go.mod | 8 ++++---- radix-cluster-cleanup/go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/radix-cluster-cleanup/go.mod b/radix-cluster-cleanup/go.mod index 1335b84..809e6cf 100644 --- a/radix-cluster-cleanup/go.mod +++ b/radix-cluster-cleanup/go.mod @@ -50,11 +50,11 @@ require ( github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.19.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/radix-cluster-cleanup/go.sum b/radix-cluster-cleanup/go.sum index a159b05..a0e3163 100644 --- a/radix-cluster-cleanup/go.sum +++ b/radix-cluster-cleanup/go.sum @@ -129,8 +129,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -142,8 +142,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -163,12 +163,12 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= From a1d5feff5a236b463d6cb5ca3af33da39eaedefa Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 15:48:34 +0200 Subject: [PATCH 02/14] Build multiplatform. Added context --- .github/workflows/build-push.yml | 184 ++++++++++++++---- .github/workflows/config/common.cfg | 2 - .github/workflows/config/master/dev.cfg | 4 - .../workflows/config/release/playground.cfg | 4 - .github/workflows/pr.yml | 49 +++++ .github/workflows/pull-request-check.yml | 31 --- .github/workflows/scripts/build-push.sh | 22 --- Dockerfile | 36 ++-- Dockerfile.goreleaser | 2 +- Makefile | 2 +- radix-cluster-cleanup/cmd/deleteRrs.go | 8 +- .../cmd/listRrForDeletion.go | 12 +- radix-cluster-cleanup/cmd/listRrForStop.go | 12 +- .../cmd/listRrForStopAndDeletion.go | 10 +- radix-cluster-cleanup/cmd/root.go | 28 +-- radix-cluster-cleanup/cmd/stopAndDeleteRrs.go | 10 +- radix-cluster-cleanup/cmd/stopRrs.go | 8 +- radix-cluster-cleanup/go.mod | 69 ++++--- radix-cluster-cleanup/go.sum | 182 ++++++++--------- radix-cluster-cleanup/main.go | 9 +- run_cluster_cleanup.sh | 2 +- 21 files changed, 404 insertions(+), 282 deletions(-) delete mode 100644 .github/workflows/config/common.cfg delete mode 100644 .github/workflows/config/master/dev.cfg delete mode 100644 .github/workflows/config/release/playground.cfg create mode 100644 .github/workflows/pr.yml delete mode 100644 .github/workflows/pull-request-check.yml delete mode 100755 .github/workflows/scripts/build-push.sh diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index e5d2fca..b958736 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -1,50 +1,166 @@ -name: radix-cluster-cleanup-build +name: Build & push on: push: branches: - - master - - release + - master + - release + - set-arm64-platform + workflow_dispatch: permissions: id-token: write + contents: read + jobs: - get-target-configs: - name: Get target configs for branch - outputs: - target_configs: ${{ steps.get-target-configs.outputs.target_configs }} - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - - name: Get target configs - id: get-target-configs - run: | - configs=$(ls $GITHUB_WORKSPACE/.github/workflows/config/${GITHUB_REF_NAME} | jq -Rsc '. / "\n" - [""]') - echo ::set-output name=target_configs::${configs} - - build-push-acr: - name: Build & push + build-deploy: runs-on: ubuntu-20.04 - needs: - - get-target-configs strategy: fail-fast: false - matrix: - config: ${{ fromJson(needs.get-target-configs.outputs.target_configs) }} + matrix: + target: + - name: "dev" + ref: "refs/heads/master" + acr-name: "radixdev" + client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" + subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" + + - name: "dev2" + ref: "refs/heads/set-arm64-platform" + acr-name: "radixdev" + client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" + subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" + + - name: "playground" + ref: "refs/heads/release" + acr-name: "radixdev" + client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" + subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" + + - name: "platform" + ref: "refs/heads/release" + acr-name: "radixprod" + client-id: "4ac3be6d-c4df-46be-ba6c-55d490a024f5" + subscription-id: "ded7ca41-37c8-4085-862f-b11d21ab341a" + + - name: "c2" + ref: "refs/heads/release" + acr-name: "radixc2prod" + client-id: "4ac3be6d-c4df-46be-ba6c-55d490a024f5" + subscription-id: "ded7ca41-37c8-4085-862f-b11d21ab341a" + steps: - uses: actions/checkout@v4 - - name: Persist environment from ${{ matrix.config }} across steps + if: matrix.target.ref == github.ref + + - uses: azure/login@v2 + if: matrix.target.ref == github.ref + with: + client-id: ${{matrix.target.client-id}} + tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0" + subscription-id: ${{matrix.target.subscription-id}} + + - name: Get GitHub Public IP + if: matrix.target.ref == github.ref + id: github_public_ip + run: echo "ipv4=$(curl 'https://ifconfig.me/ip')" >> $GITHUB_OUTPUT + + - name: Add GitHub IP to ACR + if: matrix.target.ref == github.ref + id: update_firewall + run: az acr network-rule add + --name ${{matrix.target.acr-name}} + --subscription ${{matrix.target.subscription-id}} + --ip-address ${{ steps.github_public_ip.outputs.ipv4 }} + + - name: Wait for 2 minutes while the network rule to take effect + if: matrix.target.ref == github.ref + run: | + sleep 120 + + - name: Wait for Specific IP in ACR Network Rules + if: matrix.target.ref == github.ref run: | - env_vars_from_cfg=`env -i GITHUB_WORKSPACE=$GITHUB_WORKSPACE /bin/bash -c "set -a && source $GITHUB_WORKSPACE/.github/workflows/config/${GITHUB_REF_NAME}/${{ matrix.config }} && printenv"` - for env_var in $env_vars_from_cfg - do - echo $env_var >> $GITHUB_ENV + MAX_ATTEMPTS=10 + ATTEMPT=0 + TARGET_IP="${{ steps.github_public_ip.outputs.ipv4 }}" + echo "Waiting for IP $TARGET_IP to be allowed in ACR network rules..." + while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do + NETWORK_RULES=$(az acr network-rule list --name ${{matrix.target.acr-name}} --subscription ${{ matrix.target.subscription-id }} --query "ipRules[]|[?contains(ipAddressOrRange, '$TARGET_IP')]" --output tsv) + if [ -n "$NETWORK_RULES" ]; then + echo "IP $TARGET_IP is allowed." + break + fi + echo "Attempt $((ATTEMPT+1)) of $MAX_ATTEMPTS. Retrying in 10 seconds..." + ATTEMPT=$((ATTEMPT+1)) + sleep 10 done + if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then + echo "IP $TARGET_IP was not allowed after $MAX_ATTEMPTS attempts. Exiting." + exit 1 + fi + + - name: Get ACR Login Server + if: matrix.target.ref == github.ref + id: get-acr-login-server + run: | + echo "login_server=$(az acr show --name ${{ matrix.target.acr-name }} --query loginServer --output tsv)" >> $GITHUB_OUTPUT - - uses: azure/login@v1 + - name: Get ACR Access Token + if: matrix.target.ref == github.ref + id: get-acr-token + run: | + echo "Getting ACR access token" + access_token=$(az acr login --name ${{ matrix.target.acr-name }} --expose-token --output tsv --query accessToken) + echo "::add-mask::$access_token" + echo "access_token=$access_token" >> $GITHUB_OUTPUT + + - name: Log in to ACR + if: matrix.target.ref == github.ref + uses: docker/login-action@v3 with: - client-id: ${{ env.AZURE_CLIENT_ID }} - tenant-id: ${{ env.AZURE_TENANT_ID }} - subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} - - - name: Build image + registry: ${{ steps.get-acr-login-server.outputs.login_server }} + username: "00000000-0000-0000-0000-000000000000" + password: ${{ steps.get-acr-token.outputs.access_token }} + + - name: Set up Docker Buildx + if: matrix.target.ref == github.ref + uses: docker/setup-buildx-action@v3 + + - name: Build an image name + if: matrix.target.ref == github.ref + id: build-image-name run: | - $GITHUB_WORKSPACE/.github/workflows/scripts/build-push.sh \ No newline at end of file + echo "image-name=${{ matrix.target.acr-name }}.azurecr.io/radix-cluster-cleanup" >> $GITHUB_OUTPUT + + - name: Build an image tag + if: matrix.target.ref == github.ref + id: build-tag + run: | + sha=${GITHUB_SHA::8} + ts=$(date +%s) + echo "tag=${GITHUB_REF_NAME}-${sha}-${ts}" >> $GITHUB_OUTPUT + + - name: Extract labels from metadata for Docker + if: matrix.target.ref == github.ref + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ steps.build-image-name.outputs.image-name }} + + - name: Build and push Docker image + if: matrix.target.ref == github.ref + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: | + linux/amd64 + linux/arm64 + tags: "${{ steps.build-image-name.outputs.image-name }}:${{ steps.build-tag.outputs.tag }}" + labels: ${{ steps.meta.outputs.labels }} + + - name: Revoke GitHub IP on ACR + if: ${{ matrix.target.ref == github.ref && steps.update_firewall.outcome == 'success' && !cancelled()}} # Always run this step even if previous step failed + run: az acr network-rule remove + --name ${{matrix.target.acr-name}} + --subscription ${{matrix.target.subscription-id}} + --ip-address ${{ steps.github_public_ip.outputs.ipv4 }} diff --git a/.github/workflows/config/common.cfg b/.github/workflows/config/common.cfg deleted file mode 100644 index 098dbd5..0000000 --- a/.github/workflows/config/common.cfg +++ /dev/null @@ -1,2 +0,0 @@ -AZURE_TENANT_ID=3aa4a235-b6e2-48d5-9195-7fcf05b459b0 -IMAGE_NAME=radix-cluster-cleanup \ No newline at end of file diff --git a/.github/workflows/config/master/dev.cfg b/.github/workflows/config/master/dev.cfg deleted file mode 100644 index 4126980..0000000 --- a/.github/workflows/config/master/dev.cfg +++ /dev/null @@ -1,4 +0,0 @@ -source $GITHUB_WORKSPACE/.github/workflows/config/common.cfg -ACR_NAME=radixdev -AZURE_CLIENT_ID=bc7934db-95bc-40b0-b9b8-c0944b0f6937 -AZURE_SUBSCRIPTION_ID=16ede44b-1f74-40a5-b428-46cca9a5741b \ No newline at end of file diff --git a/.github/workflows/config/release/playground.cfg b/.github/workflows/config/release/playground.cfg deleted file mode 100644 index 4126980..0000000 --- a/.github/workflows/config/release/playground.cfg +++ /dev/null @@ -1,4 +0,0 @@ -source $GITHUB_WORKSPACE/.github/workflows/config/common.cfg -ACR_NAME=radixdev -AZURE_CLIENT_ID=bc7934db-95bc-40b0-b9b8-c0944b0f6937 -AZURE_SUBSCRIPTION_ID=16ede44b-1f74-40a5-b428-46cca9a5741b \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..4e12c73 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,49 @@ +name: radix-cluster-cleanup-pr +on: + pull_request: + branches: + - master +jobs: + build: + name: pull-request-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: false + platforms: | + linux/amd64 + linux/arm64 + + test: + name: Unit Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Install dependencies + run: go mod download + - name: Run Tests + run: go test -cover `go list ./...` + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.58.2 diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml deleted file mode 100644 index ff8723b..0000000 --- a/.github/workflows/pull-request-check.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: radix-cluster-cleanup-pr -on: - pull_request: - branches: - - master -jobs: - build: - name: pull-request-check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build docker image - env: - REF: ${{ github. sha }} - run: docker build -t radix-cluster-cleanup:${REF##*/} . - - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 - with: - version: v1.55.2 - working-directory: radix-cluster-cleanup diff --git a/.github/workflows/scripts/build-push.sh b/.github/workflows/scripts/build-push.sh deleted file mode 100755 index 290127b..0000000 --- a/.github/workflows/scripts/build-push.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - - -sha=${GITHUB_SHA::8} -ts=$(date +%s) -build_id=${GITHUB_REF_NAME}-${sha}-${ts} - -image_tag=${ACR_NAME}.azurecr.io/${IMAGE_NAME}:$build_id -az acr task run \ - --subscription ${AZURE_SUBSCRIPTION_ID} \ - --name radix-image-builder-internal \ - --registry ${ACR_NAME} \ - --context ${GITHUB_WORKSPACE} \ - --file ${GITHUB_WORKSPACE}/Dockerfile \ - --set DOCKER_REGISTRY=${ACR_NAME} \ - --set BRANCH=${GITHUB_REF_NAME} \ - --set TAGS="--tag ${image_tag}" \ - --set DOCKER_FILE_NAME=Dockerfile \ - --set PUSH="--push" \ - --set REPOSITORY_NAME=${IMAGE_NAME} \ - --set CACHE="" \ - --set CACHE_TO_OPTIONS="--cache-to=type=registry,ref=${ACR_NAME}.azurecr.io/${IMAGE_NAME}:radix-cache-${GITHUB_REF_NAME},mode=max" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 795b89a..ba33079 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,24 @@ -FROM golang:1.21-alpine3.19 as builder +FROM docker.io/golang:1.22-alpine3.20 AS builder -ENV GO111MODULE=on +ENV CGO_ENABLED=0 \ + GOOS=linux -RUN apk update && \ - apk add ca-certificates && \ - apk add --no-cache gcc musl-dev - -WORKDIR /go/src/github.com/equinor/radix-cluster-cleanup +WORKDIR /src # Install project dependencies -COPY radix-cluster-cleanup/go.mod radix-cluster-cleanup/go.sum ./ +COPY ./radix-cluster-cleanup/go.mod ./radix-cluster-cleanup/go.sum ./ RUN go mod download +# Copy and build project code COPY ./radix-cluster-cleanup . +RUN go build -ldflags="-s -w" -o /build/radix-cluster-cleanup -# build -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o /usr/local/bin/radix-cluster-cleanup - -RUN addgroup -S -g 1000 radix-cluster-cleanup -RUN adduser -S -u 1000 -G radix-cluster-cleanup radix-cluster-cleanup +COPY ./run_cluster_cleanup.sh . -# Run operator -FROM alpine:3 -COPY run_cluster_cleanup.sh /run_cluster_cleanup.sh -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /usr/local/bin/radix-cluster-cleanup /radix-cluster-cleanup -USER radix-cluster-cleanup -ENTRYPOINT ["/run_cluster_cleanup.sh"] +# Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless +FROM gcr.io/distroless/static +WORKDIR /app +COPY --from=builder /build/radix-cluster-cleanup . +COPY --from=builder /src/run_cluster_cleanup.sh . +USER 1000 +ENTRYPOINT ["/app/run_cluster_cleanup.sh"] diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index e5e741a..a9ab5af 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -1,4 +1,4 @@ -FROM alpine:3.19 +FROM alpine3.20 RUN apk update && apk add ca-certificates && apk add bash && rm -rf /var/cache/apk/* RUN addgroup -S -g 1000 radix && adduser -S -u 1000 -G radix radix diff --git a/Makefile b/Makefile index bdc6f58..b0b323a 100644 --- a/Makefile +++ b/Makefile @@ -8,5 +8,5 @@ HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;) bootstrap: ifndef HAS_GOLANGCI_LINT - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1 endif diff --git a/radix-cluster-cleanup/cmd/deleteRrs.go b/radix-cluster-cleanup/cmd/deleteRrs.go index 1eb603e..f7de05c 100644 --- a/radix-cluster-cleanup/cmd/deleteRrs.go +++ b/radix-cluster-cleanup/cmd/deleteRrs.go @@ -31,7 +31,7 @@ var deleteRrsContinuouslyCommand = &cobra.Command{ Short: "Continuously delete inactive RadixRegistrations", Long: "Continuously delete inactive RadixRegistrations", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(deleteRrs) + return runFunctionPeriodically(cmd.Context(), deleteRrs) }, } @@ -40,7 +40,7 @@ var deleteRrsCommand = &cobra.Command{ Short: "Delete inactive RadixRegistrations", Long: "Delete inactive RadixRegistrations", RunE: func(cmd *cobra.Command, args []string) error { - return deleteRrs() + return deleteRrs(cmd.Context()) }, } @@ -49,7 +49,7 @@ func init() { rootCmd.AddCommand(deleteRrsContinuouslyCommand) } -func deleteRrs() error { +func deleteRrs(ctx context.Context) error { kubeClient, err := getKubeUtil() if err != nil { return err @@ -60,7 +60,7 @@ func deleteRrs() error { return err } inactivityBeforeDeletion := time.Hour * 24 * time.Duration(inactiveDaysBeforeDeletion) - tooInactiveRrs, err := getTooInactiveRrs(kubeClient, inactivityBeforeDeletion, action) + tooInactiveRrs, err := getTooInactiveRrs(ctx, kubeClient, inactivityBeforeDeletion, action) if err != nil { return err } diff --git a/radix-cluster-cleanup/cmd/listRrForDeletion.go b/radix-cluster-cleanup/cmd/listRrForDeletion.go index 2cca893..b355ed4 100644 --- a/radix-cluster-cleanup/cmd/listRrForDeletion.go +++ b/radix-cluster-cleanup/cmd/listRrForDeletion.go @@ -15,10 +15,12 @@ package cmd import ( + "context" "fmt" - "github.com/equinor/radix-cluster-cleanup/pkg/settings" "time" + "github.com/equinor/radix-cluster-cleanup/pkg/settings" + "github.com/spf13/cobra" ) @@ -27,7 +29,7 @@ var listRrsForDeletionContinuouslyCommand = &cobra.Command{ Short: "Continuously lists RadixRegistrations which qualify for deletion", Long: "Continuously lists RadixRegistrations which qualify for deletion.", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(listRrsForDeletion) + return runFunctionPeriodically(cmd.Context(), listRrsForDeletion) }, } @@ -36,11 +38,11 @@ var listRrsForDeletionCommand = &cobra.Command{ Short: "Lists RadixRegistrations which qualify for deletion", Long: "Lists RadixRegistrations which qualify for deletion.", RunE: func(cmd *cobra.Command, args []string) error { - return listRrsForDeletion() + return listRrsForDeletion(cmd.Context()) }, } -func listRrsForDeletion() error { +func listRrsForDeletion(ctx context.Context) error { kubeClient, err := getKubeUtil() if err != nil { return err @@ -51,7 +53,7 @@ func listRrsForDeletion() error { return err } inactivityBeforeDeletion := time.Hour * 24 * time.Duration(inactiveDaysBeforeDeletion) - tooInactiveRrs, err := getTooInactiveRrs(kubeClient, inactivityBeforeDeletion, action) + tooInactiveRrs, err := getTooInactiveRrs(ctx, kubeClient, inactivityBeforeDeletion, action) if err != nil { return err } diff --git a/radix-cluster-cleanup/cmd/listRrForStop.go b/radix-cluster-cleanup/cmd/listRrForStop.go index d4a9472..80efbc0 100644 --- a/radix-cluster-cleanup/cmd/listRrForStop.go +++ b/radix-cluster-cleanup/cmd/listRrForStop.go @@ -15,10 +15,12 @@ package cmd import ( + "context" "fmt" - "github.com/equinor/radix-cluster-cleanup/pkg/settings" "time" + "github.com/equinor/radix-cluster-cleanup/pkg/settings" + "github.com/spf13/cobra" ) @@ -27,7 +29,7 @@ var listRrsForStopContinuouslyCommand = &cobra.Command{ Short: "Continuously list RadixRegistrations which qualify for stop", Long: "Continuously list RadixRegistrations which qualify for stop", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(listRrsForStop) + return runFunctionPeriodically(cmd.Context(), listRrsForStop) }, } @@ -36,11 +38,11 @@ var listRrsForStopCommand = &cobra.Command{ Short: "Lists RadixRegistrations which qualify for stop", Long: "Lists RadixRegistrations which qualify for stop.", RunE: func(cmd *cobra.Command, args []string) error { - return listRrsForStop() + return listRrsForStop(cmd.Context()) }, } -func listRrsForStop() error { +func listRrsForStop(ctx context.Context) error { kubeClient, err := getKubeUtil() if err != nil { return err @@ -51,7 +53,7 @@ func listRrsForStop() error { return err } inactivityBeforeStop := time.Hour * 24 * time.Duration(inactiveDaysBeforeStop) - tooInactiveRrs, err := getTooInactiveRrs(kubeClient, inactivityBeforeStop, action) + tooInactiveRrs, err := getTooInactiveRrs(ctx, kubeClient, inactivityBeforeStop, action) if err != nil { return err } diff --git a/radix-cluster-cleanup/cmd/listRrForStopAndDeletion.go b/radix-cluster-cleanup/cmd/listRrForStopAndDeletion.go index c61d65d..0e50e76 100644 --- a/radix-cluster-cleanup/cmd/listRrForStopAndDeletion.go +++ b/radix-cluster-cleanup/cmd/listRrForStopAndDeletion.go @@ -15,6 +15,8 @@ package cmd import ( + "context" + "github.com/spf13/cobra" ) @@ -23,16 +25,16 @@ var listRrsForStopAndDeletionContinuouslyCommand = &cobra.Command{ Short: "Continuously list RadixRegistrations which qualify for stop and deletion", Long: "Continuously list RadixRegistrations which qualify for stop and deletion", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(listRrsForStopAndDeletion) + return runFunctionPeriodically(cmd.Context(), listRrsForStopAndDeletion) }, } -func listRrsForStopAndDeletion() error { - err := listRrsForStop() +func listRrsForStopAndDeletion(ctx context.Context) error { + err := listRrsForStop(ctx) if err != nil { return err } - return listRrsForDeletion() + return listRrsForDeletion(ctx) } func init() { diff --git a/radix-cluster-cleanup/cmd/root.go b/radix-cluster-cleanup/cmd/root.go index 9d45e89..b3d04bf 100644 --- a/radix-cluster-cleanup/cmd/root.go +++ b/radix-cluster-cleanup/cmd/root.go @@ -10,6 +10,11 @@ import ( "strings" "time" + "github.com/equinor/radix-cluster-cleanup/pkg/settings" + "github.com/equinor/radix-common/utils/delaytick" + "github.com/equinor/radix-common/utils/timewindow" + "github.com/equinor/radix-operator/pkg/apis/kube" + v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" @@ -19,12 +24,6 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "github.com/equinor/radix-acr-cleanup/pkg/delaytick" - "github.com/equinor/radix-acr-cleanup/pkg/timewindow" - "github.com/equinor/radix-cluster-cleanup/pkg/settings" - "github.com/equinor/radix-operator/pkg/apis/kube" - v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - "github.com/equinor/radix-operator/pkg/apis/utils" radixclient "github.com/equinor/radix-operator/pkg/client/clientset/versioned" ) @@ -52,12 +51,13 @@ var rootCmd = &cobra.Command{ return err } - return initZerologger(logLevel, prettyPrint) + return initZeroLogger(logLevel, prettyPrint) }, } // Execute the top level command -func Execute() { +func Execute(ctx context.Context) { + rootCmd.SetContext(ctx) if err := rootCmd.Execute(); err != nil { fmt.Println("parsing command line arguments failed:", err) fmt.Println(err) @@ -78,7 +78,7 @@ func init() { rootCmd.PersistentFlags().String(settings.LogLevel, "info", "Set output log level, allowed values: debug, info, warn, error or fatal") } -func initZerologger(logLevel string, prettyPrint bool) error { +func initZeroLogger(logLevel string, prettyPrint bool) error { if logLevel == "" { logLevel = zerolog.InfoLevel.String() } @@ -145,14 +145,14 @@ func getKubernetesClient() (kubernetes.Interface, radixclient.Interface) { func getKubeUtil() (*kube.Kube, error) { kubeClient, radixClient := getKubernetesClient() - kubeutil, err := kube.New(kubeClient, radixClient, nil) + kubeutil, err := kube.New(kubeClient, radixClient, nil, nil) if err != nil { return nil, err } return kubeutil, nil } -func runFunctionPeriodically(someFunc func() error) error { +func runFunctionPeriodically(ctx context.Context, someFunc func(ctx context.Context) error) error { cleanupDays, cleanupDaysErr := rootCmd.Flags().GetStringSlice(settings.CleanUpDaysOption) cleanupStart, cleanupStartErr := rootCmd.Flags().GetString(settings.CleanUpStartOption) cleanupEnd, cleanupEndErr := rootCmd.Flags().GetString(settings.CleanUpEndOption) @@ -172,7 +172,7 @@ func runFunctionPeriodically(someFunc func() error) error { pointInTime := time.Now() if window.Contains(pointInTime) { log.Info().Msgf("Start listing RRs for stop %s", pointInTime) - err := someFunc() + err := someFunc(ctx) if err != nil { return err } @@ -184,8 +184,8 @@ func runFunctionPeriodically(someFunc func() error) error { return nil } -func getTooInactiveRrs(kubeClient *kube.Kube, inactivityLimit time.Duration, action string) ([]v1.RadixRegistration, error) { - rrs, err := kubeClient.ListRegistrations() +func getTooInactiveRrs(ctx context.Context, kubeClient *kube.Kube, inactivityLimit time.Duration, action string) ([]v1.RadixRegistration, error) { + rrs, err := kubeClient.ListRegistrations(ctx) if err != nil { return nil, err } diff --git a/radix-cluster-cleanup/cmd/stopAndDeleteRrs.go b/radix-cluster-cleanup/cmd/stopAndDeleteRrs.go index 6515929..bfb8791 100644 --- a/radix-cluster-cleanup/cmd/stopAndDeleteRrs.go +++ b/radix-cluster-cleanup/cmd/stopAndDeleteRrs.go @@ -15,6 +15,8 @@ package cmd import ( + "context" + "github.com/spf13/cobra" ) @@ -23,16 +25,16 @@ var StopAndDeleteRrsContinuouslyCommand = &cobra.Command{ Short: "Continuously stop and delete inactive RRs", Long: "Continuously stop and delete inactive RRs", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(stopAndDeleteInactiveRrs) + return runFunctionPeriodically(cmd.Context(), stopAndDeleteInactiveRrs) }, } -func stopAndDeleteInactiveRrs() error { - err := stopRrs() +func stopAndDeleteInactiveRrs(ctx context.Context) error { + err := stopRrs(ctx) if err != nil { return err } - return deleteRrs() + return deleteRrs(ctx) } func init() { diff --git a/radix-cluster-cleanup/cmd/stopRrs.go b/radix-cluster-cleanup/cmd/stopRrs.go index 1a17c5f..724641e 100644 --- a/radix-cluster-cleanup/cmd/stopRrs.go +++ b/radix-cluster-cleanup/cmd/stopRrs.go @@ -33,7 +33,7 @@ var stopRrsContinuouslyCommand = &cobra.Command{ Short: "Continuously stop all components in inactive RadixRegistrations", Long: "Continuously stop all components in inactive RadixRegistrations", RunE: func(cmd *cobra.Command, args []string) error { - return runFunctionPeriodically(stopRrs) + return runFunctionPeriodically(cmd.Context(), stopRrs) }, } @@ -42,11 +42,11 @@ var stopRrsCommand = &cobra.Command{ Short: "Stop all components in inactive RadixRegistrations", Long: "Stop all components in inactive RadixRegistrations", RunE: func(cmd *cobra.Command, args []string) error { - return stopRrs() + return stopRrs(cmd.Context()) }, } -func stopRrs() error { +func stopRrs(ctx context.Context) error { kubeClient, err := getKubeUtil() if err != nil { return err @@ -57,7 +57,7 @@ func stopRrs() error { return err } inactivityBeforeStop := time.Hour * 24 * time.Duration(inactiveDaysBeforeStop) - tooInactiveRrs, err := getTooInactiveRrs(kubeClient, inactivityBeforeStop, action) + tooInactiveRrs, err := getTooInactiveRrs(ctx, kubeClient, inactivityBeforeStop, action) if err != nil { return err } diff --git a/radix-cluster-cleanup/go.mod b/radix-cluster-cleanup/go.mod index 809e6cf..cb97659 100644 --- a/radix-cluster-cleanup/go.mod +++ b/radix-cluster-cleanup/go.mod @@ -1,16 +1,16 @@ module github.com/equinor/radix-cluster-cleanup -go 1.21 +go 1.22.0 -toolchain go1.21.0 +toolchain go1.22.5 require ( - github.com/equinor/radix-acr-cleanup v0.0.0-20240311082036-1512e0ae5441 - github.com/equinor/radix-operator v1.50.4 - github.com/rs/zerolog v1.32.0 - github.com/spf13/cobra v1.8.0 - k8s.io/apimachinery v0.29.0 - k8s.io/client-go v0.29.0 + github.com/equinor/radix-common v1.9.3 + github.com/equinor/radix-operator v1.57.1 + github.com/rs/zerolog v1.33.0 + github.com/spf13/cobra v1.8.1 + k8s.io/apimachinery v0.30.2 + k8s.io/client-go v0.30.2 ) require ( @@ -19,55 +19,62 @@ require ( github.com/cert-manager/cert-manager v1.14.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/equinor/radix-common v1.7.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.2 // indirect + github.com/evanphx/json-patch v5.8.1+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/expr-lang/expr v1.15.8 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.20.2 // indirect github.com/go-openapi/jsonreference v0.20.4 // indirect github.com/go-openapi/swag v0.22.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.5.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kedacore/keda/v2 v2.13.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/mattn/go-isatty v0.0.20 // 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-operator/prometheus-operator/pkg/apis/monitoring v0.70.0 // indirect github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.53.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.19.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.33.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.29.0 // indirect - k8s.io/apiextensions-apiserver v0.29.0 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 // indirect - k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect - sigs.k8s.io/controller-runtime v0.16.3 // indirect + k8s.io/api v0.30.2 // indirect + k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect + knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 // indirect + sigs.k8s.io/controller-runtime v0.18.2 // indirect sigs.k8s.io/gateway-api v1.0.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/secrets-store-csi-driver v1.4.0 // indirect diff --git a/radix-cluster-cleanup/go.sum b/radix-cluster-cleanup/go.sum index a0e3163..1f9dc51 100644 --- a/radix-cluster-cleanup/go.sum +++ b/radix-cluster-cleanup/go.sum @@ -7,24 +7,29 @@ github.com/cert-manager/cert-manager v1.14.2/go.mod h1:pik7K6jXfgh++lfVJ/i1HzEnD github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/equinor/radix-acr-cleanup v0.0.0-20240311082036-1512e0ae5441 h1:vPNDgdUVBiGwsZglW6j4TZaHVXFgjlW5v/gf2UCdAUo= -github.com/equinor/radix-acr-cleanup v0.0.0-20240311082036-1512e0ae5441/go.mod h1:ICxmpRt6LbMmcqqlBO3HTdGn10E8waIYY7dfI2PQWoo= -github.com/equinor/radix-common v1.7.1 h1:kl7Tuo2VEo2WHGm/vkvktrZ9t9S3Nht7Mob3CSIzcJI= -github.com/equinor/radix-common v1.7.1/go.mod h1:M6mhgHtFQ3rnjJnyOuECXiZOh7XQ5xVeHMyCAU+YPzQ= -github.com/equinor/radix-operator v1.50.4 h1:xLuOtwNjuuQ2apEyT8TkNINMMsHvuFTkyOg6Nf1RJbE= -github.com/equinor/radix-operator v1.50.4/go.mod h1:bLL8hVfdEUuucNRGUit33uBjUhuunpNWO5youmZz8e8= -github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= -github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= +github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/equinor/radix-common v1.9.3 h1:dLKFzYy8/XyEG9Zygi0rMWIYGCddai/ILwUqjBiGYxQ= +github.com/equinor/radix-common v1.9.3/go.mod h1:+g0Wj0D40zz29DjNkYKVmCVeYy4OsFWKI7Qi9rA6kpY= +github.com/equinor/radix-operator v1.57.1 h1:5nhKdF13MZ9oooxr5+n3OOXMUrr7g1U9GGSeKysfcq0= +github.com/equinor/radix-operator v1.57.1/go.mod h1:zCdAiP/wxyvlUO4qGoJuLW3O+ZSt9kTyHMnjmsR3fCU= +github.com/evanphx/json-patch v5.8.1+incompatible h1:2toJaoe7/rNa1zpeQx0UnVEjqk6z2ecyA20V/zg8vTU= +github.com/evanphx/json-patch v5.8.1+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/expr-lang/expr v1.15.8 h1:FL8+d3rSSP4tmK9o+vKfSMqqpGL8n15pEPiHcnBpxoI= +github.com/expr-lang/expr v1.15.8/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= @@ -36,25 +41,24 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 h1:dHLYa5D8/Ta0aLR2XcPsrkpAgGeFs6thhMcQK0oQ0n8= +github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -63,6 +67,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kedacore/keda/v2 v2.13.1 h1:8y4Mp4iWyiqHoedVT3q2g5xvWDe494TRH3sUCZPpn/o= +github.com/kedacore/keda/v2 v2.13.1/go.mod h1:AZTRgxWpK5/6pq+DqJ15y3Bl/C8sl9C7tUVF4phzGDQ= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -74,10 +80,9 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -86,10 +91,10 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -99,82 +104,82 @@ github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0 h github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0/go.mod h1:npfc20mPOAu7ViOVnATVMbI7PoXvW99EzgJVqkAomIQ= github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0 h1:PpdpJDS1MyMSLILG+Y0hgzVQ3tu6qEkRD0gR/UuvSZk= github.com/prometheus-operator/prometheus-operator/pkg/client v0.70.0/go.mod h1:4I5Rt6iIu95JBYYaDYA+Er+YBfUwIq9Pwh5TEoBmawg= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= +golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -182,19 +187,16 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -205,22 +207,24 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= -k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= -k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= -k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= -k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= -k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= -k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= -k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022 h1:avRdiaB03v88Mfvum2S3BBwkNuTlmuar4LlfO9Hajko= -k8s.io/kube-openapi v0.0.0-20240103051144-eec4567ac022/go.mod h1:sIV51WBTkZrlGOJMCDZDA1IaPBUDTulPpD4y7oe038k= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= -sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= +k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= +k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= +k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= +k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= +k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= +k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 h1:H6+JJN23fhwYWCHY1339sY6uhIyoUwDy1a8dN233fdk= +knative.dev/pkg v0.0.0-20240116073220-b488e7be5902/go.mod h1:NYk8mMYoLkO7CQWnNkti4YGGnvLxN6MIDbUvtgeo0C0= +sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLqlNpx+Q= +sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/radix-cluster-cleanup/main.go b/radix-cluster-cleanup/main.go index 23ee5e7..4d10c0b 100644 --- a/radix-cluster-cleanup/main.go +++ b/radix-cluster-cleanup/main.go @@ -1,6 +1,10 @@ package main import ( + "context" + "os/signal" + "syscall" + "github.com/equinor/radix-cluster-cleanup/cmd" ) @@ -8,5 +12,8 @@ func init() { } func main() { - cmd.Execute() + ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGTERM) + defer cancel() + cmd.Execute(ctx) + <-ctx.Done() } diff --git a/run_cluster_cleanup.sh b/run_cluster_cleanup.sh index d6b8c37..0fb9e0a 100755 --- a/run_cluster_cleanup.sh +++ b/run_cluster_cleanup.sh @@ -1,5 +1,5 @@ #!/bin/sh -LOG_LEVEL=${LOG_LEVEL} /radix-cluster-cleanup "${COMMAND}" \ +LOG_LEVEL=${LOG_LEVEL} ./radix-cluster-cleanup "${COMMAND}" \ --period=${PERIOD} \ --cleanup-start=${CLEANUP_START} \ --cleanup-end=${CLEANUP_END} \ From a49b28c4f8491aa800b663cb54a637a1bfb4a495 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 15:51:08 +0200 Subject: [PATCH 03/14] Fire build --- .github/workflows/build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index b958736..61ff1ee 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -23,7 +23,7 @@ jobs: client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" - - name: "dev2" + - name: "dev3" ref: "refs/heads/set-arm64-platform" acr-name: "radixdev" client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" From 86895a0108c70105bfbd1f9a5ae10a7c39bc6057 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 15:58:52 +0200 Subject: [PATCH 04/14] Set go version --- .github/workflows/pr.yml | 1 + Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4e12c73..720da30 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,7 @@ on: pull_request: branches: - master + - set-arm64-platform jobs: build: name: pull-request-check diff --git a/Dockerfile b/Dockerfile index ba33079..2ea3912 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.22-alpine3.20 AS builder +FROM docker.io/golang:1.22.5-alpine3.20 AS builder ENV CGO_ENABLED=0 \ GOOS=linux From 86675a1799d5344800f816529e4a3effcccb47ce Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:03:49 +0200 Subject: [PATCH 05/14] Set go version --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 720da30..dea7c56 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: './radix-cluster-cleanup/go.mod' - name: Install dependencies run: go mod download - name: Run Tests From 690ced15d6036db5f89774bb8d1c59f1dc0dd1a2 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:09:00 +0200 Subject: [PATCH 06/14] Set go version --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dea7c56..4b27469 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: go mod download - name: Run Tests - run: go test -cover `go list ./...` + run: go test -cover `go list ./radix-cluster-cleanup/...` lint: name: Lint @@ -43,7 +43,7 @@ jobs: fetch-depth: 2 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: './radix-cluster-cleanup/go.mod' - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: From ea5a99ce0c9572aac234721f8b184e8b914c8efc Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:25:06 +0200 Subject: [PATCH 07/14] Set go version --- .github/workflows/pr.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4b27469..67aa624 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,11 +28,15 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: './radix-cluster-cleanup/go.mod' + go-version-file: 'go.mod' - name: Install dependencies - run: go mod download + run: | + cd ./radix-cluster-cleanup + go mod download - name: Run Tests - run: go test -cover `go list ./radix-cluster-cleanup/...` + run: | + cd ./radix-cluster-cleanup + go test -cover `go list ./...` lint: name: Lint From c7f5f44ab3379c2ddd0d2fcc0b431e2814aa71a4 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:26:55 +0200 Subject: [PATCH 08/14] Set go version --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 67aa624..40de8de 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: './radix-cluster-cleanup/go.mod' - name: Install dependencies run: | cd ./radix-cluster-cleanup From a594e610e35aaeec6edad8246e5d7c917898caf5 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:32:00 +0200 Subject: [PATCH 09/14] Set go version --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 40de8de..a042997 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -48,6 +48,8 @@ jobs: - uses: actions/setup-go@v5 with: go-version-file: './radix-cluster-cleanup/go.mod' + - name: Change folder + run: cd ./radix-cluster-cleanup - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: From 21e503d961e4232f618677269b883fde0d993aac Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:35:22 +0200 Subject: [PATCH 10/14] Set go version --- .github/workflows/pr.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a042997..9367609 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -48,9 +48,8 @@ jobs: - uses: actions/setup-go@v5 with: go-version-file: './radix-cluster-cleanup/go.mod' - - name: Change folder - run: cd ./radix-cluster-cleanup - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: version: v1.58.2 + working-directory: './radix-cluster-cleanup' From 8217046a0aeefa3c3e78c2726c54565ca86a20b3 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Tue, 16 Jul 2024 16:48:27 +0200 Subject: [PATCH 11/14] Set go version --- .github/workflows/build-push.yml | 7 ------- .github/workflows/pr.yml | 1 - charts/radix-cluster-cleanup/Chart.yaml | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 61ff1ee..15b5dea 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -4,7 +4,6 @@ on: branches: - master - release - - set-arm64-platform workflow_dispatch: permissions: id-token: write @@ -23,12 +22,6 @@ jobs: client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" - - name: "dev3" - ref: "refs/heads/set-arm64-platform" - acr-name: "radixdev" - client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" - subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" - - name: "playground" ref: "refs/heads/release" acr-name: "radixdev" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9367609..63ce939 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,6 @@ on: pull_request: branches: - master - - set-arm64-platform jobs: build: name: pull-request-check diff --git a/charts/radix-cluster-cleanup/Chart.yaml b/charts/radix-cluster-cleanup/Chart.yaml index 88de078..1f16b2f 100644 --- a/charts/radix-cluster-cleanup/Chart.yaml +++ b/charts/radix-cluster-cleanup/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: 1.0.11 +appVersion: 1.0.12 description: A Helm chart for Kubernetes name: radix-cluster-cleanup -version: 1.0.12 +version: 1.0.13 From 21e6824f52df1a730d74fe1aa0a9e49e38ea676d Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Wed, 17 Jul 2024 10:01:39 +0200 Subject: [PATCH 12/14] Fixed missing shell --- Dockerfile | 5 ++++- charts/radix-cluster-cleanup/Chart.yaml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ea3912..308f669 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,13 @@ RUN go build -ldflags="-s -w" -o /build/radix-cluster-cleanup COPY ./run_cluster_cleanup.sh . +#Get busybox shell for distroless +FROM gcr.io/distroless/base:debug AS debug # Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless FROM gcr.io/distroless/static WORKDIR /app COPY --from=builder /build/radix-cluster-cleanup . COPY --from=builder /src/run_cluster_cleanup.sh . +COPY --from=debug /busybox/sh /bin USER 1000 -ENTRYPOINT ["/app/run_cluster_cleanup.sh"] +ENTRYPOINT ["/app/run_cluster_cleanup.sh"] \ No newline at end of file diff --git a/charts/radix-cluster-cleanup/Chart.yaml b/charts/radix-cluster-cleanup/Chart.yaml index 1f16b2f..5ed8011 100644 --- a/charts/radix-cluster-cleanup/Chart.yaml +++ b/charts/radix-cluster-cleanup/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: 1.0.12 +appVersion: 1.0.13 description: A Helm chart for Kubernetes name: radix-cluster-cleanup -version: 1.0.13 +version: 1.0.14 From cc90ba4c3fb93edfb111374805ae1b27dd50755e Mon Sep 17 00:00:00 2001 From: Automatic Update Date: Wed, 17 Jul 2024 13:39:59 +0200 Subject: [PATCH 13/14] Change Client-id dev --- .github/workflows/build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 15b5dea..efeaeac 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -19,7 +19,7 @@ jobs: - name: "dev" ref: "refs/heads/master" acr-name: "radixdev" - client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" + client-id: "2bfe6984-f5e3-4d09-a0b2-4dd96de3f21e" subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" - name: "playground" From d74395eb8ef1113e7e0583bb7dd195c0dfa8f5c9 Mon Sep 17 00:00:00 2001 From: Automatic Update Date: Wed, 17 Jul 2024 15:23:59 +0200 Subject: [PATCH 14/14] new-mi-cluster-playground --- .github/workflows/build-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index efeaeac..ea171d1 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -24,8 +24,8 @@ jobs: - name: "playground" ref: "refs/heads/release" - acr-name: "radixdev" - client-id: "bc7934db-95bc-40b0-b9b8-c0944b0f6937" + acr-name: "radixplayground" + client-id: "7c000a42-1edb-4491-a241-4ac77bf7dd6d" subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" - name: "platform"