Skip to content

Commit

Permalink
Updated downstream libraries, go version, and other tlc
Browse files Browse the repository at this point in the history
  • Loading branch information
cnmcavoy committed Jan 13, 2025
1 parent 733f2e2 commit d35871f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -57,9 +53,7 @@ linters:
- dupl
- durationcheck
- errcheck
- execinquery
- exhaustive
- exportloopref
- gocritic
- godot
- gofmt
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.22 as builder
FROM --platform=$BUILDPLATFORM golang:1.23 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/harbor-container-webhook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/webhook/manifest.go
Original file line number Diff line number Diff line change
@@ -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"`
}
Expand All @@ -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"`
Expand Down

0 comments on commit d35871f

Please sign in to comment.