diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39ec8cea..6b7ffe6b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,12 +11,21 @@ updates: schedule: interval: "weekly" - - package-ecosystem: "docker" - directory: "/package" + - package-ecosystem: "github-actions" + directory: "/" labels: - "kind/dependabot" reviewers: - "k3s-io/k3s-dev" schedule: - interval: "weekly" + interval: "cron" + cronjob: "0 0 1 */3 *" # Every 3rd month + groups: + action-deps: + patterns: + - "*" + ignore: + - dependency-name: "*" + update-types: + - "version-update:semver-patch" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ff93f662..5ea165c5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' @@ -29,10 +29,10 @@ jobs: ARCH: amd64 steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' @@ -47,3 +47,31 @@ jobs: - name: E2E Test run: ./scripts/e2e + + build-arm64: + runs-on: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 + + - name: Build arm64 binary + run: docker buildx build --platform linux/arm64 --target binary --output type=local,dest=. . + + build-riscv64: + if: github.repository_owner == 'k3s-io' + runs-on: cncf-ubuntu-8-32-x86 + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + + - name: Set up QEMU + uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 + + - name: Build riscv64 binary + run: docker buildx build --platform linux/riscv64 --target binary --output type=local,dest=. . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74fa08a2..be09da11 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,16 +20,16 @@ jobs: id-token: write # needed for the Vault authentication steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Set up QEMU - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 + uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' @@ -37,7 +37,7 @@ jobs: run: make - name: Upload binary - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: helm-controller-amd64 path: ./dist/artifacts/* @@ -52,7 +52,7 @@ jobs: - name: Docker source meta id: meta - uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 + uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 with: images: | ${{ env.DOCKERHUB_REPO }} @@ -68,7 +68,7 @@ jobs: - name: Login to DockerHub with Rancher Secrets if: github.repository_owner == 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ env.DOCKER_USERNAME }} password: ${{ env.DOCKER_TOKEN }} @@ -76,13 +76,13 @@ jobs: # For forks, setup DockerHub login with GHA secrets - name: Login to DockerHub with GHA Secrets if: github.repository_owner != 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Login to GitHub Container Registry - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -90,7 +90,7 @@ jobs: - name: Build and push by digest id: build - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 + uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 with: platforms: linux/amd64 context: . # Required to see the new binary file we just built @@ -104,7 +104,7 @@ jobs: touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: digests-amd64 path: ${{ runner.temp }}/digests/* @@ -123,7 +123,7 @@ jobs: id-token: write # needed for the Vault authentication steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Set ARCH run: | @@ -134,10 +134,10 @@ jobs: fi - name: Set up QEMU - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 + uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 - name: Build binary run: | @@ -145,7 +145,7 @@ jobs: cp ./bin/helm-controller ./bin/helm-controller-${{ env.ARCH }} - name: Upload binary - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: helm-controller-${{ env.ARCH }} path: ./bin/helm-controller-${{ env.ARCH }} @@ -160,7 +160,7 @@ jobs: - name: Docker source meta id: meta - uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 + uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 with: images: | ${{ env.DOCKERHUB_REPO }} @@ -176,7 +176,7 @@ jobs: - name: Login to DockerHub with Rancher Secrets if: github.repository_owner == 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ env.DOCKER_USERNAME }} password: ${{ env.DOCKER_TOKEN }} @@ -184,13 +184,13 @@ jobs: # For forks, setup DockerHub login with GHA secrets - name: Login to DockerHub with GHA Secrets if: github.repository_owner != 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Login to GitHub Container Registry - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -198,7 +198,7 @@ jobs: - name: Build and push by digest id: build - uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 + uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 with: platforms: linux/${{ matrix.platform }} context: . # Required to see the new binary file we just built @@ -212,7 +212,105 @@ jobs: touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: digests-${{ env.ARCH }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + build-riscv64: + runs-on: ${{ github.repository_owner == 'k3s-io' && 'cncf-ubuntu-8-32-x86' || 'ubuntu-latest' }} + env: + ARCH: riscv64 + permissions: + contents: read + packages: write + id-token: write # needed for the Vault authentication + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + + - name: Set up QEMU + uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 + + - name: Build binary + run: | + docker buildx build --platform linux/riscv64 --target binary --output type=local,dest=. . + cp ./bin/helm-controller ./bin/helm-controller-${{ env.ARCH }} + + - name: Upload binary + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: helm-controller-${{ env.ARCH }} + path: ./bin/helm-controller-${{ env.ARCH }} + + - name: Set DOCKERHUB_REPO + run: | + if [ "${{ github.repository_owner }}" == "k3s-io" ]; then + echo "DOCKERHUB_REPO=rancher/helm-controller" >> $GITHUB_ENV + else + echo "DOCKERHUB_REPO=${{ secrets.DOCKER_USERNAME }}/helm-controller" >> $GITHUB_ENV + fi + + - name: Docker source meta + id: meta + uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 + with: + images: | + ${{ env.DOCKERHUB_REPO }} + ${{ env.GHCR_REPO }} + + - name: "Read Vault secrets" + if: github.repository_owner == 'k3s-io' + uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3 + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_TOKEN ; + + - name: Login to DockerHub with Rancher Secrets + if: github.repository_owner == 'k3s-io' + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 + with: + username: ${{ env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_TOKEN }} + + # For forks, setup DockerHub login with GHA secrets + - name: Login to DockerHub with GHA Secrets + if: github.repository_owner != 'k3s-io' + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push by digest + id: build + uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 + with: + platforms: linux/${{ env.ARCH }} + context: . # Required to see the new binary file we just built + outputs: type=image,"name=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true + target: production + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: digests-${{ env.ARCH }} path: ${{ runner.temp }}/digests/* @@ -223,10 +321,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Setup Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' @@ -234,16 +332,16 @@ jobs: run: go test ./pkg/... -cover -tags=test binary-release: - needs: [build, build-arm, test] + needs: [build, build-arm, build-riscv64, test] runs-on: ubuntu-latest permissions: contents: write # Needed to update release with binary assets steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Download binaries - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: helm-controller-* path: ./dist/artifacts @@ -251,7 +349,7 @@ jobs: - name: Compute checksum for each binary run: | - arch=("amd64" "arm64" "arm") + arch=("amd64" "arm64" "arm" "riscv64") cd dist/artifacts ls for a in "${arch[@]}"; do @@ -259,7 +357,7 @@ jobs: done - name: Upload binaries to release - uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2 + uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v2 with: files: | dist/artifacts/helm-controller-* @@ -272,13 +370,14 @@ jobs: needs: - build - build-arm + - build-riscv64 permissions: contents: read packages: write id-token: write # needed for the Vault authentication steps: - name: Download digests - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: ${{ runner.temp }}/digests pattern: digests-* @@ -302,7 +401,7 @@ jobs: - name: Login to DockerHub with Rancher Secrets if: github.repository_owner == 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ env.DOCKER_USERNAME }} password: ${{ env.DOCKER_TOKEN }} @@ -310,24 +409,24 @@ jobs: # For forks, setup DockerHub login with GHA secrets - name: Login to DockerHub with GHA Secrets if: github.repository_owner != 'k3s-io' - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Login to GitHub Container Registry - uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 - name: Docker meta id: meta - uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 + uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 with: images: | ${{ env.DOCKERHUB_REPO }} diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index fb7dd81e..be9a1c39 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -18,15 +18,15 @@ jobs: if: github.ref == 'refs/heads/master' steps: - name: Checkout - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install Go - uses: actions/setup-go@7b8cf10d4e4a01d4992d18a89f4d7dc5a3e6d6f4 # v4 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: 'stable' - name: Install Updatecli - uses: updatecli/updatecli-action@4b17f4ea784de29f71f85f9bc4955402ba1ae53c # v2.100.0 + uses: updatecli/updatecli-action@5bda7da77bf4d181bce5f807d73d832b62062acf # v3.3.0 - name: Delete leftover UpdateCLI branches run: | diff --git a/Dockerfile b/Dockerfile index 6e52dd3d..013a59f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,6 +54,6 @@ FROM scratch AS crds COPY --from=builder /src/pkg/crds/yaml/generated/ / COPY --from=builder /src/doc/helmchart.md /tmp_doc/ -FROM alpine:3.23 AS production +FROM alpine:3.24 AS production COPY bin/helm-controller /usr/bin/ CMD ["helm-controller"] diff --git a/go.mod b/go.mod index 92353d02..81274b26 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,33 @@ module github.com/k3s-io/helm-controller -go 1.24.12 +go 1.25.0 require ( - github.com/go-logr/logr v1.4.2 + github.com/go-logr/logr v1.4.3 github.com/onsi/ginkgo/v2 v2.22.2 github.com/onsi/gomega v1.36.2 github.com/rancher/lasso v0.2.2 github.com/rancher/wrangler/v3 v3.2.1 github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.1 github.com/urfave/cli/v2 v2.27.5 - k8s.io/api v0.34.4 - k8s.io/apiextensions-apiserver v0.32.1 - k8s.io/apimachinery v0.34.4 - k8s.io/client-go v0.34.4 + k8s.io/api v0.34.9 + k8s.io/apiextensions-apiserver v0.34.9 + k8s.io/apimachinery v0.34.9 + k8s.io/client-go v0.34.9 k8s.io/klog/v2 v2.130.1 - k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 + k8s.io/kubernetes v1.34.9 + k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 sigs.k8s.io/yaml v1.6.0 ) require ( - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/reference v0.6.0 // indirect github.com/emicklei/go-restful/v3 v3.12.2 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect @@ -45,36 +47,45 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.23.0 // indirect - golang.org/x/net v0.38.0 // indirect - golang.org/x/oauth2 v0.27.0 // indirect - golang.org/x/sync v0.12.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/term v0.30.0 // indirect - golang.org/x/text v0.23.0 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.55.0 // indirect + golang.org/x/oauth2 v0.30.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.45.0 // indirect + golang.org/x/term v0.43.0 // indirect + golang.org/x/text v0.37.0 // indirect golang.org/x/time v0.9.0 // indirect - golang.org/x/tools v0.30.0 // indirect - google.golang.org/protobuf v1.36.5 // indirect - gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + golang.org/x/tools v0.44.0 // indirect + golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect + google.golang.org/protobuf v1.36.8 // indirect + gopkg.in/evanphx/json-patch.v4 v4.13.0 // 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/code-generator v0.32.1 // indirect + k8s.io/apiserver v0.34.9 // indirect + k8s.io/code-generator v0.34.9 // indirect + k8s.io/component-base v0.34.9 // indirect + k8s.io/component-helpers v0.34.9 // indirect + k8s.io/controller-manager v0.34.9 // indirect k8s.io/gengo v0.0.0-20250130153323-76c5745d3511 // indirect k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect + k8s.io/kubelet v0.34.9 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect diff --git a/go.sum b/go.sum index 23c091d9..789edcdc 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,7 @@ -cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= -cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= +cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -12,12 +10,14 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3 github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= -github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 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/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= @@ -29,8 +29,8 @@ github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj2 github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= @@ -43,8 +43,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g= -github.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= +github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI= +github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -56,9 +56,8 @@ github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/Z github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -67,8 +66,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 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/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -92,31 +91,33 @@ github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= 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= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= 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.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rancher/lasso v0.2.2 h1:oKP5d4+eSupwHftLMTWo6QS1tYYZ5XK+ZjP+VNhwmk8= github.com/rancher/lasso v0.2.2/go.mod h1:KSV3jBXfdXqdCuMm2uC8kKB9q/wuDYb3h0eHZoRjShM= github.com/rancher/wrangler/v3 v3.2.1 h1:V51PnoGb8bZ5jJdxFlqKQApzWdSp4sEy5OPGuEGqVbI= github.com/rancher/wrangler/v3 v3.2.1/go.mod h1:RV8kkv5br5HaxXWamIbr95pOjvVeoC5CeBldcdw5Fv0= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -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/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -127,8 +128,8 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -137,22 +138,24 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= -go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= -go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= -go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= -go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= -go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= -go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= 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/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= @@ -168,33 +171,33 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= 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.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= 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.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= -golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= 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.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= 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.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -202,27 +205,30 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 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.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools/go/expect v0.1.0-deprecated h1:jY2C5HGYR5lqex3gEniOQL0r7Dq5+VGVgY1nudX5lXY= +golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= 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/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw= -google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= -google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= -google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= +google.golang.org/grpc v1.72.1 h1:HR03wO6eyZ7lknl75XlxABNVLLFc2PAb6mHlYh756mA= +google.golang.org/grpc v1.72.1/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/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= -gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= -gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= +gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -231,20 +237,24 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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.34.4 h1:Z5hsoQcZ2yBjelb9j5JKzCVo9qv9XLkVm5llnqS4h+0= -k8s.io/api v0.34.4/go.mod h1:6SaGYuGPkMqqCgg8rPG/OQoCrhgSEV+wWn9v21fDP3o= -k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw= -k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto= -k8s.io/apimachinery v0.34.4 h1:C5SiSzLEMyWIk53sSbnk0WlOOyqv/MFnWvuc/d6M+xc= -k8s.io/apimachinery v0.34.4/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= -k8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak= -k8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw= -k8s.io/client-go v0.34.4 h1:IXhvzFdm0e897kXtLbeyMpAGzontcShJ/gi/XCCsOLc= -k8s.io/client-go v0.34.4/go.mod h1:tXIVJTQabT5QRGlFdxZQFxrIhcGUPpKL5DAc4gSWTE8= -k8s.io/code-generator v0.32.1 h1:4lw1kFNDuFYXquTkB7Sl5EwPMUP2yyW9hh6BnFfRZFY= -k8s.io/code-generator v0.32.1/go.mod h1:zaILfm00CVyP/6/pJMJ3zxRepXkxyDfUV5SNG4CjZI4= -k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk= -k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w= +k8s.io/api v0.34.9 h1:aVsK5NQL7146suJriGuvpi9giNpwIRSHJ8v5HWakwBo= +k8s.io/api v0.34.9/go.mod h1:8oYqD5tLKgvBSnkuDbHZTNrk7NTHybkfYjJ6lNjThjQ= +k8s.io/apiextensions-apiserver v0.34.9 h1:I+VcEFLE/6ueQw3v1OxPslTHD6AiGQJ1M4cUxtYelII= +k8s.io/apiextensions-apiserver v0.34.9/go.mod h1:z+ylpz3sT+7C+H9jTTfCNR7khCMPDyZVIgvvga79uYc= +k8s.io/apimachinery v0.34.9 h1:WuRPolTfoEST1TQe9sLcT1QAWLMT0CNE4Eqj29XuUmQ= +k8s.io/apimachinery v0.34.9/go.mod h1:z7dd12Xd400CXIycE8nmn32xZhApV9zskHs0A5xeU/Q= +k8s.io/apiserver v0.34.9 h1:isiEW5L0OeGi4oDvyLl+cXzKvqFROH+UqkhIYo3tAsw= +k8s.io/apiserver v0.34.9/go.mod h1:gYau4EBEsam2O3uLF+D9KP8yHpMYdojPSMNq33FQEVA= +k8s.io/client-go v0.34.9 h1:HlhSEGPyCFH5rQADW6NPKEziGns6ekgUCPK0OsOGU90= +k8s.io/client-go v0.34.9/go.mod h1:bI3Sqqmwls2JKFZOQN9h8oLaeibvIA5pqqJAaSJWnrk= +k8s.io/code-generator v0.34.9 h1:jXBgPd5FbFoN1J2uA/qISW3uLHRl8wJ9Gx6L4PiJIPk= +k8s.io/code-generator v0.34.9/go.mod h1:/doiEA33AIV4kFt4NTMCzV8N5Ued8kq1fZMWUUib990= +k8s.io/component-base v0.34.9 h1:whlBI2kU+CHKHmeByojCzHX/OTU7RjsTirkHbqDDpz0= +k8s.io/component-base v0.34.9/go.mod h1:4VmwVaGu+f+5jMIkCpmbJ0HHDu4Wu2rlWhISXAETjos= +k8s.io/component-helpers v0.34.9 h1:vnxTF9GIowfdioxkFfptSQwf2hN8axqCW2AKUdarOfc= +k8s.io/component-helpers v0.34.9/go.mod h1:z9IVmbGz3TBYt6RtOM86gYX4o3dK9KAFLlE3LtO/zWg= +k8s.io/controller-manager v0.34.9 h1:7XFUgqC/2qngt881846KTUMVnJ/lobuMT7ayCZdVWO8= +k8s.io/controller-manager v0.34.9/go.mod h1:UzcjajHcgo8DoaWICoGpYUB9spSF8h+TyfxrCuJUmXY= k8s.io/gengo v0.0.0-20250130153323-76c5745d3511 h1:4eL6zr5VCj71nu2nOuQ6j6m/kqh5WueXBN8daZkNe90= k8s.io/gengo v0.0.0-20250130153323-76c5745d3511/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f h1:SLb+kxmzfA87x4E4brQzB33VBbT2+x7Zq9ROIHmGn9Q= @@ -254,10 +264,14 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA= k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +k8s.io/kubelet v0.34.9 h1:gL2tDk5Kdv6ghUoyIYJZiZuZYTwsz5YhqqookZfcbQk= +k8s.io/kubelet v0.34.9/go.mod h1:74mk09f1XfTUsw6Zv97IiBQlHFlFzw3UmNWk8+MZkbg= +k8s.io/kubernetes v1.34.9 h1:qj8W8mftZkTEBMdNjGBp+pKGbvpewrnCiuDp2l4DxtU= +k8s.io/kubernetes v1.34.9/go.mod h1:ECvwZXn8HlXIVDdB4RwZxboj5YhwMZ+COzc6yRMFMX4= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= diff --git a/main.go b/main.go index 218ea505..78074ca1 100644 --- a/main.go +++ b/main.go @@ -7,101 +7,22 @@ package main import ( + "context" + "errors" _ "net/http/pprof" "os" - "github.com/k3s-io/helm-controller/pkg/cmd" - "github.com/k3s-io/helm-controller/pkg/version" + "github.com/k3s-io/helm-controller/pkg/app" _ "github.com/rancher/wrangler/v3/pkg/generated/controllers/apiextensions.k8s.io" _ "github.com/rancher/wrangler/v3/pkg/generated/controllers/networking.k8s.io" "github.com/rancher/wrangler/v3/pkg/signals" "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" ) -var config = cmd.HelmController{} - func main() { - app := &cli.App{ - Name: "helm-controller", - Description: "A simple way to manage helm charts with CRDs in K8s.", - Version: version.FriendlyVersion(), - Action: func(app *cli.Context) error { - return config.Run(app) - }, - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "controller-name", - Value: "helm-controller", - Usage: "Unique name to identify this controller that is added to all HelmCharts tracked by this controller", - EnvVars: []string{"CONTROLLER_NAME"}, - Destination: &config.ControllerName, - }, - &cli.BoolFlag{ - Name: "debug", - Usage: "Turn on debug logging", - Destination: &config.Debug, - }, - &cli.IntFlag{ - Name: "debug-level", - Usage: "If debugging is enabled, set klog -v=X", - Destination: &config.DebugLevel, - }, - &cli.StringFlag{ - Name: "default-job-image", - Usage: "Default image to use by jobs managing helm charts", - EnvVars: []string{"DEFAULT_JOB_IMAGE"}, - Destination: &config.DefaultJobImage, - }, - &cli.StringFlag{ - Name: "job-cluster-role", - Value: "cluster-admin", - Usage: "Name of the cluster role to use for jobs created to manage helm charts", - EnvVars: []string{"JOB_CLUSTER_ROLE"}, - Destination: &config.JobClusterRole, - }, - &cli.StringFlag{ - Name: "kubeconfig", - Usage: "Kubernetes config files, e.g. $HOME/.kube/config", - EnvVars: []string{"KUBECONFIG"}, - Destination: &config.Kubeconfig, - }, - &cli.StringFlag{ - Name: "master-url", - Usage: "Kubernetes cluster master URL", - EnvVars: []string{"MASTERURL"}, - Destination: &config.MasterURL, - }, - &cli.StringFlag{ - Name: "namespace", - Usage: "Namespace to watch, empty means it will watch CRDs in all namespaces", - EnvVars: []string{"NAMESPACE"}, - Destination: &config.Namespace, - }, - &cli.StringFlag{ - Name: "node-name", - Usage: "Name of the node this controller is running on", - EnvVars: []string{"NODE_NAME"}, - Destination: &config.NodeName, - }, - &cli.IntFlag{ - Name: "pprof-port", - Value: 6060, - Usage: "Port to publish HTTP server runtime profiling data in the format expected by the pprof visualization tool. Only enabled if in debug mode", - Destination: &config.PprofPort, - }, - &cli.IntFlag{ - Name: "threads", - Value: 2, - Usage: "Threadiness level to set", - EnvVars: []string{"THREADS"}, - Destination: &config.Threads, - }, - }, - } - + app := app.New() ctx := signals.SetupSignalContext() - if err := app.RunContext(ctx, os.Args); err != nil { + if err := app.RunContext(ctx, os.Args); err != nil && !errors.Is(err, context.Canceled) { logrus.Fatal(err) } } diff --git a/pkg/app/app.go b/pkg/app/app.go new file mode 100644 index 00000000..9baf9026 --- /dev/null +++ b/pkg/app/app.go @@ -0,0 +1,111 @@ +package app + +import ( + "github.com/k3s-io/helm-controller/pkg/cmd" + "github.com/k3s-io/helm-controller/pkg/config" + "github.com/k3s-io/helm-controller/pkg/version" + "github.com/urfave/cli/v2" +) + +var cliconfig config.CLI + +func New() *cli.App { + return &cli.App{ + Name: "helm-controller", + Description: "A simple way to manage helm charts with CRDs in K8s.", + Version: version.FriendlyVersion(), + Action: func(app *cli.Context) error { + return cmd.Run(app.Context, cliconfig) + }, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "controller-name", + Value: "helm-controller", + Usage: "Unique name to identify this controller that is added to all HelmCharts tracked by this controller", + EnvVars: []string{"CONTROLLER_NAME"}, + Destination: &cliconfig.ControllerName, + }, + &cli.BoolFlag{ + Name: "debug", + Usage: "Turn on debug logging", + Destination: &cliconfig.Debug, + }, + &cli.IntFlag{ + Name: "debug-level", + Usage: "If debugging is enabled, set klog -v=X", + Destination: &cliconfig.DebugLevel, + }, + &cli.StringFlag{ + Name: "job-resources", + Value: `{"requests": {"cpu": "0.1", "memory": "10M"}, "limits": {"cpu": "32", "memory": "32G"}}`, + Usage: "JSON spec of resource limits and requests to apply to containers for all jobs managing helm charts", + EnvVars: []string{"JOB_RESOURCES"}, + Destination: &cliconfig.JobResources, + }, + &cli.StringFlag{ + Name: "default-job-image", + Usage: "Default image to use by jobs managing helm charts", + EnvVars: []string{"DEFAULT_JOB_IMAGE"}, + Destination: &cliconfig.DefaultJobImage, + }, + &cli.StringFlag{ + Name: "job-tolerations", + Usage: "JSON array of tolerations to apply to all jobs managing helm charts", + EnvVars: []string{"JOB_TOLERATIONS"}, + Destination: &cliconfig.JobTolerations, + }, + &cli.StringFlag{ + Name: "job-cluster-role", + Value: "cluster-admin", + Usage: "Name of the cluster role to use for jobs created to manage helm charts", + EnvVars: []string{"JOB_CLUSTER_ROLE"}, + Destination: &cliconfig.JobClusterRole, + }, + &cli.StringFlag{ + Name: "kubeconfig", + Usage: "Kubernetes config files, e.g. $HOME/.kube/config", + EnvVars: []string{"KUBECONFIG"}, + Destination: &cliconfig.Kubeconfig, + }, + &cli.StringFlag{ + Name: "master-url", + Usage: "Kubernetes cluster master URL", + EnvVars: []string{"MASTERURL"}, + Destination: &cliconfig.MasterURL, + }, + &cli.StringFlag{ + Name: "namespace", + Usage: "Namespace to watch, empty means it will watch CRDs in all namespaces", + EnvVars: []string{"NAMESPACE"}, + Destination: &cliconfig.Namespace, + }, + &cli.StringFlag{ + Name: "node-name", + Usage: "Name of the node this controller is running on", + EnvVars: []string{"NODE_NAME"}, + Destination: &cliconfig.NodeName, + }, + &cli.IntFlag{ + Name: "pprof-port", + Value: 6060, + Usage: "Port to publish HTTP server runtime profiling data in the format expected by the pprof visualization tool. Only enabled if in debug mode", + Destination: &cliconfig.PprofPort, + }, + &cli.IntFlag{ + Name: "threads", + Value: 2, + Usage: "Threadiness level to set", + EnvVars: []string{"THREADS"}, + Destination: &cliconfig.Threads, + }, + }, + } +} + +// Config returns the controller config provided by parsing the provided CLI flags. +func Config(args []string) (*config.Controller, error) { + a := New() + a.Action = func(*cli.Context) error { return nil } + a.Run(append([]string{a.Name}, args...)) + return cliconfig.GetControllerConfig() +} diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index 6cb0055b..ce8b51fb 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -1,19 +1,20 @@ package cmd import ( + "context" "fmt" "log" "net/http" "time" "github.com/go-logr/logr" + "github.com/k3s-io/helm-controller/pkg/config" "github.com/k3s-io/helm-controller/pkg/controllers" "github.com/k3s-io/helm-controller/pkg/controllers/common" "github.com/k3s-io/helm-controller/pkg/crds" "github.com/rancher/wrangler/v3/pkg/crd" "github.com/rancher/wrangler/v3/pkg/kubeconfig" "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" @@ -25,29 +26,15 @@ const ( readyDuration = time.Minute * 1 ) -type HelmController struct { - Debug bool - DebugLevel int - Kubeconfig string - MasterURL string - Namespace string - Threads int - ControllerName string - NodeName string - JobClusterRole string - DefaultJobImage string - PprofPort int -} - -func (hc *HelmController) SetupLogging() (logr.Logger, error) { +func SetupLogging(debug bool) (logr.Logger, error) { klog.EnableContextualLogging(true) - if hc.Debug { + if debug { logrus.SetLevel(logrus.DebugLevel) } return common.NewLogrusSink(nil).AsLogr(), nil } -func (hc *HelmController) Run(app *cli.Context) error { +func Run(ctx context.Context, hc config.CLI) error { if hc.Debug && hc.PprofPort > 0 { go func() { // Serves HTTP server runtime profiling data in the format expected by the @@ -56,12 +43,13 @@ func (hc *HelmController) Run(app *cli.Context) error { log.Println(http.ListenAndServe(fmt.Sprintf("localhost:%d", hc.PprofPort), nil)) }() } - logger, err := hc.SetupLogging() + logger, err := SetupLogging(hc.Debug) if err != nil { return err } + ctx = klog.NewContext(ctx, logger) - cfg := hc.GetNonInteractiveClientConfig() + cfg := getNonInteractiveClientConfig(hc) rest, err := cfg.ClientConfig() if err != nil { return err @@ -71,21 +59,13 @@ func (hc *HelmController) Run(app *cli.Context) error { return err } - ctx := klog.NewContext(app.Context, logger) - crds, err := crds.List() if err != nil { return err } - opts := common.Options{ - Threadiness: hc.Threads, - NodeName: hc.NodeName, - JobClusterRole: hc.JobClusterRole, - DefaultJobImage: hc.DefaultJobImage, - } - - if err := opts.Validate(); err != nil { + opts, err := hc.GetControllerConfig() + if err != nil { return err } @@ -98,10 +78,10 @@ func (hc *HelmController) Run(app *cli.Context) error { } <-ctx.Done() - return nil + return ctx.Err() } -func (hc *HelmController) GetNonInteractiveClientConfig() clientcmd.ClientConfig { +func getNonInteractiveClientConfig(hc config.CLI) clientcmd.ClientConfig { // Modified https://github.com/rancher/wrangler/blob/3ecd23dfea3bb4c76cbe8e06fb158eed6ae3dd31/pkg/kubeconfig/loader.go#L12-L32 return clientcmd.NewInteractiveDeferredLoadingClientConfig( kubeconfig.GetLoadingRules(hc.Kubeconfig), diff --git a/pkg/config/types.go b/pkg/config/types.go new file mode 100644 index 00000000..12e6cefa --- /dev/null +++ b/pkg/config/types.go @@ -0,0 +1,56 @@ +package config + +import ( + "fmt" + + corev1 "k8s.io/api/core/v1" +) + +type CLI struct { + Debug bool + DebugLevel int + Kubeconfig string + MasterURL string + Namespace string + Threads int + ControllerName string + NodeName string + JobClusterRole string + DefaultJobImage string + JobTolerations string + JobResources string + PprofPort int +} + +func (c CLI) GetControllerConfig() (*Controller, error) { + resources, err := parseResources(c.JobResources) + if err != nil { + return nil, fmt.Errorf("invalid job-resources JSON: %w", err) + } + tolerations, err := parseTolerations(c.JobTolerations) + if err != nil { + return nil, fmt.Errorf("invalid --job-tolerations JSON: %w", err) + } + + if c.Threads <= 0 { + return nil, fmt.Errorf("cannot start with thread count of %d, please pass a proper thread count", c.Threads) + } + + return &Controller{ + Threadiness: c.Threads, + NodeName: c.NodeName, + JobClusterRole: c.JobClusterRole, + DefaultJobImage: c.DefaultJobImage, + JobTolerations: tolerations, + JobResources: resources, + }, nil +} + +type Controller struct { + Threadiness int + NodeName string + JobClusterRole string + DefaultJobImage string + JobTolerations []corev1.Toleration + JobResources *corev1.ResourceRequirements +} diff --git a/pkg/config/validation.go b/pkg/config/validation.go new file mode 100644 index 00000000..4c3919b4 --- /dev/null +++ b/pkg/config/validation.go @@ -0,0 +1,63 @@ +package config + +import ( + "encoding/json" + "strings" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/validation/field" + typedcore "k8s.io/kubernetes/pkg/apis/core" + typedcorev1 "k8s.io/kubernetes/pkg/apis/core/v1" + "k8s.io/kubernetes/pkg/apis/core/validation" +) + +var scheme = runtime.NewScheme() +var opts = validation.PodValidationOptions{} + +func init() { + typedcorev1.RegisterConversions(scheme) +} + +func parseResources(raw string) (*corev1.ResourceRequirements, error) { + raw = strings.TrimSpace(raw) + if raw == "" { + return nil, nil + } + resources := &corev1.ResourceRequirements{} + if err := json.Unmarshal([]byte(raw), resources); err != nil { + return nil, err + } + coreResources := &typedcore.ResourceRequirements{} + if err := scheme.Convert(resources, coreResources, nil); err != nil { + return nil, err + } + if err := validation.ValidateContainerResourceRequirements(coreResources, nil, field.NewPath("pod-resources"), opts).ToAggregate(); err != nil { + return nil, err + } + return resources, nil +} + +// parseTolerations takes the CLI string and parses it into a slice of corev1.Toleration objects +func parseTolerations(raw string) ([]corev1.Toleration, error) { + raw = strings.TrimSpace(raw) + if raw == "" { + return nil, nil + } + tolerations := []corev1.Toleration{} + if err := json.Unmarshal([]byte(raw), &tolerations); err != nil { + return nil, err + } + coreTolerations := []typedcore.Toleration{} + for _, t := range tolerations { + c := typedcore.Toleration{} + if err := scheme.Convert(&t, &c, nil); err != nil { + return nil, err + } + coreTolerations = append(coreTolerations, c) + } + if err := validation.ValidateTolerations(coreTolerations, field.NewPath("job-tolerations")).ToAggregate(); err != nil { + return nil, err + } + return tolerations, nil +} diff --git a/pkg/controllers/chart/chart.go b/pkg/controllers/chart/chart.go index f7fadc2d..32a09f23 100644 --- a/pkg/controllers/chart/chart.go +++ b/pkg/controllers/chart/chart.go @@ -31,7 +31,6 @@ import ( rbac "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/fields" @@ -71,8 +70,9 @@ const ( var ( commaRE = regexp.MustCompile(`\\*,`) - deletePolicy = metav1.DeletePropagationForeground DefaultJobImage = "rancher/klipper-helm:latest" + JobTolerations []corev1.Toleration + JobResources *corev1.ResourceRequirements DefaultFailurePolicy = FailurePolicyReinstall defaultBackOffLimit = ptr.To(int32(1000)) jobSettleTime = time.Second * 3 @@ -729,16 +729,6 @@ func job(chart *v1.HelmChart, apiServerPort string) (*batch.Job, *corev1.Secret, Value: fmt.Sprintf("%t", chart.Spec.PlainHTTP), }, }, - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("0.1"), - corev1.ResourceMemory: resource.MustParse("10M"), - }, - Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("32"), - corev1.ResourceMemory: resource.MustParse("32G"), - }, - }, SecurityContext: securityContext, VolumeMounts: []corev1.VolumeMount{ { @@ -862,7 +852,9 @@ func job(chart *v1.HelmChart, apiServerPort string) (*batch.Job, *corev1.Secret, setAuthSecret(job, chart) setDockerRegistrySecret(job, chart) setRepoCAConfigMap(job, chart) + setPodResources(job) setSecurityContext(job, chart) + setTolerations(job) valuesSecret := setValuesSecret(job, chart) contentConfigMap := setContentConfigMap(job, chart) @@ -1293,6 +1285,12 @@ func setBackOffLimit(job *batch.Job, backOffLimit *int32) { job.Spec.BackoffLimit = backOffLimit } +func setPodResources(job *batch.Job) { + if JobResources != nil { + job.Spec.Template.Spec.Containers[0].Resources = *JobResources.DeepCopy() + } +} + func setSecurityContext(job *batch.Job, chart *v1.HelmChart) { if chart.Spec.PodSecurityContext != nil { job.Spec.Template.Spec.SecurityContext = chart.Spec.PodSecurityContext @@ -1303,6 +1301,12 @@ func setSecurityContext(job *batch.Job, chart *v1.HelmChart) { } } +func setTolerations(job *batch.Job) { + if len(JobTolerations) > 0 { + job.Spec.Template.Spec.Tolerations = append(job.Spec.Template.Spec.Tolerations, JobTolerations...) + } +} + // chartSource returns a string describing the source of the chart: // chartContent, chart URL, or repo+version func chartSource(chart *v1.HelmChart) string { diff --git a/pkg/controllers/chart/chart_test.go b/pkg/controllers/chart/chart_test.go index f5429575..f34b15ae 100644 --- a/pkg/controllers/chart/chart_test.go +++ b/pkg/controllers/chart/chart_test.go @@ -12,6 +12,7 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" @@ -155,13 +156,34 @@ func TestSetVals(t *testing.T) { func TestInstallJob(t *testing.T) { assert := assert.New(t) + oldJobResources := JobResources + defer func() { JobResources = oldJobResources }() + JobResources = &corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("10"), + corev1.ResourceMemory: resource.MustParse("10G"), + }, + } + chart := NewChart() job, _, _ := job(chart, "6443") assert.Equal("helm-install-traefik", job.Name) assert.Equal(DefaultJobImage, job.Spec.Template.Spec.Containers[0].Image) assert.Equal("helm-traefik", job.Spec.Template.Spec.ServiceAccountName) - assert.Equal("32", job.Spec.Template.Spec.Containers[0].Resources.Limits.Cpu().String()) - assert.Equal("32G", job.Spec.Template.Spec.Containers[0].Resources.Limits.Memory().String()) + assert.Equal("10", job.Spec.Template.Spec.Containers[0].Resources.Limits.Cpu().String()) + assert.Equal("10G", job.Spec.Template.Spec.Containers[0].Resources.Limits.Memory().String()) +} + +func TestInstallJobWithoutPodLimits(t *testing.T) { + assert := assert.New(t) + oldJobResources := JobResources + defer func() { JobResources = oldJobResources }() + JobResources = nil + + chart := NewChart() + job, _, _ := job(chart, "6443") + assert.Empty(job.Spec.Template.Spec.Containers[0].Resources.Requests) + assert.Empty(job.Spec.Template.Spec.Containers[0].Resources.Limits) } func TestDeleteJob(t *testing.T) { @@ -181,6 +203,38 @@ func TestInstallJobImage(t *testing.T) { assert.Equal("custom-job-image", job.Spec.Template.Spec.Containers[0].Image) } +func TestInstallJobTolerations(t *testing.T) { + assert := assert.New(t) + chart := NewChart() + oldDefaultJobTolerations := JobTolerations + defer func() { JobTolerations = oldDefaultJobTolerations }() + JobTolerations = []corev1.Toleration{{ + Key: "custom-taint", + Operator: corev1.TolerationOpExists, + Effect: corev1.TaintEffectNoSchedule, + }} + + job, _, _ := job(chart, "6443") + assert.Contains(job.Spec.Template.Spec.Tolerations, JobTolerations[0]) +} + +func TestInstallJobBootstrapAndCustomTolerations(t *testing.T) { + assert := assert.New(t) + chart := NewChart() + chart.Spec.Bootstrap = true + oldDefaultJobTolerations := JobTolerations + defer func() { JobTolerations = oldDefaultJobTolerations }() + JobTolerations = []corev1.Toleration{{ + Key: "custom-taint", + Operator: corev1.TolerationOpExists, + Effect: corev1.TaintEffectNoExecute, + }} + + job, _, _ := job(chart, "6443") + assert.GreaterOrEqual(len(job.Spec.Template.Spec.Tolerations), len(JobTolerations)+1) + assert.Contains(job.Spec.Template.Spec.Tolerations, JobTolerations[0]) +} + func TestInstallArgs(t *testing.T) { assert := assert.New(t) stringArgs := strings.Join(args(NewChart()), " ") diff --git a/pkg/controllers/common/options.go b/pkg/controllers/common/options.go deleted file mode 100644 index 71f20b5c..00000000 --- a/pkg/controllers/common/options.go +++ /dev/null @@ -1,18 +0,0 @@ -package common - -import "fmt" - -// Options defines options that can be set on initializing the Helm Controller -type Options struct { - Threadiness int - NodeName string - JobClusterRole string - DefaultJobImage string -} - -func (opts Options) Validate() error { - if opts.Threadiness <= 0 { - return fmt.Errorf("cannot start with thread count of %d, please pass a proper thread count", opts.Threadiness) - } - return nil -} diff --git a/pkg/controllers/controllers.go b/pkg/controllers/controllers.go index 3c459a2d..02bff46f 100644 --- a/pkg/controllers/controllers.go +++ b/pkg/controllers/controllers.go @@ -2,11 +2,13 @@ package controllers import ( "context" - "os" + "encoding/json" + "errors" + "fmt" "time" + "github.com/k3s-io/helm-controller/pkg/config" "github.com/k3s-io/helm-controller/pkg/controllers/chart" - "github.com/k3s-io/helm-controller/pkg/controllers/common" "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io" helmcontroller "github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io/v1" "github.com/rancher/lasso/pkg/cache" @@ -58,7 +60,11 @@ func (a *appContext) start(ctx context.Context) error { return start.All(ctx, 50, a.starters...) } -func Register(ctx context.Context, systemNamespace, controllerName string, cfg clientcmd.ClientConfig, opts common.Options) error { +func Register(ctx context.Context, systemNamespace, controllerName string, cfg clientcmd.ClientConfig, opts *config.Controller) error { + if opts == nil { + return errors.New("invalid controller config") + } + if len(controllerName) == 0 { controllerName = "helm-controller" } @@ -82,6 +88,8 @@ func Register(ctx context.Context, systemNamespace, controllerName string, cfg c if opts.DefaultJobImage != "" { chart.DefaultJobImage = opts.DefaultJobImage } + chart.JobResources = opts.JobResources + chart.JobTolerations = opts.JobTolerations chart.Register(ctx, systemNamespace, @@ -104,10 +112,13 @@ func Register(ctx context.Context, systemNamespace, controllerName string, cfg c appCtx.Core.Secret().Cache(), ) + resources, _ := json.Marshal(chart.JobResources) logger := klog.FromContext(ctx) logger.Info("Starting helm controller", "threads", opts.Threadiness) logger.Info("Using cluster role for jobs managing helm charts", "jobClusterRole", opts.JobClusterRole) logger.Info("Using default image for jobs managing helm charts", "defaultJobImage", chart.DefaultJobImage) + logger.Info("Using resource limits for jobs managing helm charts", "jobResources", string(resources)) + logger.Info("Using tolerations for jobs managing helm charts", "jobTolerationsCount", len(chart.JobTolerations)) if len(systemNamespace) == 0 { systemNamespace = metav1.NamespaceSystem @@ -119,9 +130,7 @@ func Register(ctx context.Context, systemNamespace, controllerName string, cfg c controllerLockName := controllerName + "-lock" leader.RunOrDie(ctx, systemNamespace, controllerLockName, appCtx.K8s, func(ctx context.Context) { if err := appCtx.start(ctx); err != nil { - logger.Error(err, "failed to start controllers") - //revive:disable-next-line:deep-exit - os.Exit(1) + panic(fmt.Errorf("failed to start controllers: %w", err)) } logger.Info("All controllers have been started") }) @@ -143,7 +152,7 @@ func controllerFactory(rest *rest.Config) (controller.SharedControllerFactory, e }), nil } -func newContext(ctx context.Context, cfg clientcmd.ClientConfig, systemNamespace string, opts common.Options) (*appContext, error) { +func newContext(ctx context.Context, cfg clientcmd.ClientConfig, systemNamespace string, opts *config.Controller) (*appContext, error) { client, err := cfg.ClientConfig() if err != nil { return nil, err