diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ff99280..7e64988 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -71,9 +71,9 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.6.1 + uses: docker/setup-buildx-action@v3.7.1 - name: Build Container Image - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.9.0 with: context: . file: ./Dockerfile diff --git a/.github/workflows/grype.yml b/.github/workflows/grype.yml index 19f8ac5..ebe84a2 100644 --- a/.github/workflows/grype.yml +++ b/.github/workflows/grype.yml @@ -22,9 +22,9 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.6.1 + uses: docker/setup-buildx-action@v3.7.1 - name: Build Container Image - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.9.0 with: context: . file: ./Dockerfile diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index 96f3cab..9ccf455 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -31,11 +31,11 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} - name: Install Cosign - uses: sigstore/cosign-installer@v3.6.0 + uses: sigstore/cosign-installer@v3.7.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.6.1 + uses: docker/setup-buildx-action@v3.7.1 - name: Login to Registry uses: docker/login-action@v3.3.0 with: @@ -44,7 +44,7 @@ jobs: password: ${{ secrets.GHCR_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.9.0 with: context: . file: ./Dockerfile diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index daa3de3..b13bb4e 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -22,9 +22,9 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.6.1 + uses: docker/setup-buildx-action@v3.7.1 - name: Build Container Image - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.9.0 with: context: . file: ./Dockerfile @@ -34,7 +34,7 @@ jobs: push: false tags: ghcr.io/${{ github.repository }}:trivy - name: Run Trivy Vulnerability Scanner - uses: aquasecurity/trivy-action@0.24.0 + uses: aquasecurity/trivy-action@0.27.0 with: image-ref: ghcr.io/${{ github.repository }}:trivy format: sarif diff --git a/CHANGELOG.md b/CHANGELOG.md index 616afde..9b6438b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,23 @@ + +## [v0.8.7](https://github.com/alex1989hu/kubelet-serving-cert-approver/compare/v0.8.6...v0.8.7) (2024-10-13) + +### Chore + +* bump aquasecurity/trivy-action from 0.26.0 to 0.27.0 +* bump aquasecurity/trivy-action from 0.25.0 to 0.26.0 +* bump aquasecurity/trivy-action from 0.24.0 to 0.25.0 +* as keyword should match the case of the from keyword in Dockerfile +* bump sigstore/cosign-installer from 3.6.0 to 3.7.0 +* bump docker/setup-buildx-action from 3.7.0 to 3.7.1 +* bump docker/setup-buildx-action from 3.6.1 to 3.7.0 +* bump docker/build-push-action from 6.7.0 to 6.9.0 + +### Fix + +* set logger to controller-runtime + + ## [v0.8.6](https://github.com/alex1989hu/kubelet-serving-cert-approver/compare/v0.8.5...v0.8.6) (2024-09-17) diff --git a/Dockerfile b/Dockerfile index deca0a4..5fade89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # -FROM golang:1.23.1 as builder +FROM golang:1.23.1 AS builder # To let GitHub CI driven buildx pass build arguments ARG TARGETOS diff --git a/cmd/serve.go b/cmd/serve.go index c61c38e..760ded9 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -16,7 +16,6 @@ package cmd import ( - "github.com/go-logr/logr" "github.com/go-logr/zapr" "github.com/spf13/cobra" uberzap "go.uber.org/zap" @@ -72,7 +71,7 @@ func startServer() { uberzap.Bool("debug", isDebug)) // Forward client-go klog calls to zap - klog.SetLogger(zapr.NewLogger(&setupLog)) + klog.SetLogger(zapr.NewLogger(logger.CreateLogger().Named("client-go"))) setupLog.Info("Try to talk to Kubernetes API Server, will exit in case of failure") @@ -84,6 +83,10 @@ func startServer() { setupLog.Info("pprof will be enabled", uberzap.String("port", pProfBindAddress)) } + // Set zap logger to all deferred loggers of controller-runtime to prevent it from complaining + // about log.SetLogger never being called + ctrllog.SetLogger(zapr.NewLogger(logger.CreateLogger().Named("ctrllog"))) + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Client: ctrlclient.Options{ Cache: &ctrlclient.CacheOptions{ @@ -99,9 +102,7 @@ func startServer() { LeaderElectionNamespace: namespace, LeaderElectionResourceLock: "leases", LeaderElectionID: "kubelet-serving-certificate-approver", - // Set NullLogger: https://github.com/kubernetes-sigs/controller-runtime/issues/1122 - Logger: logr.New(ctrllog.NullLogSink{}), - PprofBindAddress: pProfBindAddress, + PprofBindAddress: pProfBindAddress, }) if err != nil { setupLog.Fatal("Unable to start manager", uberzap.Error(err)) diff --git a/go.mod b/go.mod index fe59b93..177d34c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ toolchain go1.23.1 require ( github.com/cucumber/godog v0.14.1 - github.com/go-logr/logr v1.4.2 github.com/go-logr/zapr v1.3.0 github.com/prometheus/client_golang v1.19.1 github.com/prometheus/common v0.55.0 @@ -34,6 +33,7 @@ require ( github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect