diff --git a/.golangci.yml b/.golangci.yml index 755c569..ab975b1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -30,10 +30,6 @@ linters-settings: sizeThreshold: 512 gocyclo: min-complexity: 16 - golint: - min-confidence: 0 - govet: - check-shadowing: false lll: line-length: 300 misspell: @@ -57,9 +53,7 @@ linters: - dupl - durationcheck - errcheck - - execinquery - exhaustive - - exportloopref - gocritic - godot - gofmt diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f7e8f7..9fe3cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.1] - 2025-01-13 +### Changed +- Updated downstream libraries, go version, etc + ## [0.7.0] - 2024-01-31 ### Changed - Instead of querying for the node architecture and os when inspecting pods, which rarely worked, use `platforms` on the config to determine which platforms should be required when checking upstream. diff --git a/Dockerfile b/Dockerfile index bf73725..e0d3bb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM golang:1.22 as builder +FROM --platform=$BUILDPLATFORM golang:1.23 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/Makefile b/Makefile index 798c9fd..9b5e92c 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ HELM_DIR ?= deploy/charts/harbor-container-webhook OUTPUT_DIR ?= bin -RUN_GOLANGCI_LINT := go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 +RUN_GOLANGCI_LINT := go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 # check if there are any existing `git tag` values ifeq ($(shell git tag),) diff --git a/deploy/charts/harbor-container-webhook/Chart.yaml b/deploy/charts/harbor-container-webhook/Chart.yaml index f7d6599..1e769c7 100644 --- a/deploy/charts/harbor-container-webhook/Chart.yaml +++ b/deploy/charts/harbor-container-webhook/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: harbor-container-webhook description: Webhook to configure pods with harbor proxy cache projects type: application -version: 0.7.0 -appVersion: "0.7.0" +version: 0.7.1 +appVersion: "0.7.1" kubeVersion: ">= 1.16.0-0" home: https://github.com/IndeedEng-alpha/harbor-container-webhook maintainers: diff --git a/internal/config/config.go b/internal/config/config.go index 6fd3c9c..99fb944 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -36,7 +36,7 @@ func detectNamespace() string { // Fall back to the namespace associated with the service account token, if available if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { - if ns := strings.TrimSpace(string(data)); len(ns) > 0 { + if ns := strings.TrimSpace(string(data)); ns != "" { return ns } } diff --git a/internal/webhook/manifest.go b/internal/webhook/manifest.go index 930d043..37782bc 100644 --- a/internal/webhook/manifest.go +++ b/internal/webhook/manifest.go @@ -1,6 +1,6 @@ package webhook -// slimManifest is a partial representation of the oci manifest to access the mediaType +// slimManifest is a partial representation of the oci manifest to access the mediaType. type slimManifest struct { MediaType string `json:"mediaType"` } @@ -10,13 +10,13 @@ type platform struct { OS string `json:"os"` } -// indexManifest is a partial representation of the sub manifest present in a manifest list +// indexManifest is a partial representation of the sub manifest present in a manifest list. type indexManifest struct { MediaType string `json:"mediaType"` Platform platform `json:"platform"` } -// slimManifestList is a partial representation of the oci manifest list to access the supported architectures +// slimManifestList is a partial representation of the oci manifest list to access the supported architectures. type slimManifestList struct { MediaType string `json:"mediaType"` Manifests []indexManifest `json:"manifests"`