Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update all minor level dependencies #1007

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: "1.23"
go-version: "1.24"
- run: make unit-tests
- name: Upload unit-tests coverage to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: "1.23"
go-version: "1.24"
- run: make integration-tests-envtest
- run: make integration-tests-real-cluster
- name: Upload integration-tests coverage to Codecov
Expand All @@ -55,11 +55,11 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: "1.23"
go-version: "1.24"
- name: golangci-lint
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
with:
version: v1.60.3
version: v1.64.5

shellcheck:
name: Shellcheck
Expand Down
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ linters:
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- exhaustive # checks exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
- fatcontext # detects nested contexts in loops
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linters seem outdated. Should we update our config to match the new v1.64.5 version from https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322, but keep our custom settings?

Copy link
Member

@viccuad viccuad Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree. I did remove the linter for cel-policy on kubewarden/cel-policy#116

- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
Expand Down Expand Up @@ -275,13 +274,13 @@ linters:
- spancheck # checks for mistakes with OpenTelemetry/Census spans
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- stylecheck # is a replacement for golint
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- testifylint # checks usage of github.com/stretchr/testify
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- usetesting # reports uses of functions with replacement inside the testing package
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# Build the manager binary
FROM golang:1.23 AS build
FROM golang:1.24 AS build

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 @@ -202,7 +202,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo-$(GINGKO_VERSION)
KUSTOMIZE_VERSION ?= v5.4.1
CONTROLLER_TOOLS_VERSION ?= v0.16.1
ENVTEST_VERSION ?= release-0.18
GOLANGCI_LINT_VERSION ?= v1.60.3
GOLANGCI_LINT_VERSION ?= v1.64.5
GINGKO_VERSION ?= v2.22.0

.PHONY: kustomize
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/kubewarden/kubewarden-controller

go 1.23.0

toolchain go1.23.6
toolchain go1.24.0

require (
github.com/go-logr/logr v1.4.2
Expand Down
1 change: 0 additions & 1 deletion internal/controller/policyserver_controller_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func getMetricsPort() int32 {
fmt.Fprintf(os.Stderr, "port %s provided in %s envvar cannot be parsed as integer: %v. Aborting.\n", envMetricsPort, constants.PolicyServerMetricsPortEnvVar, err)
os.Exit(1)
}
//nolint:gosec // ParseInt(x,x,32) makes sure it will fit into int32
metricsPort = int32(metricsPortInt32)
}
return metricsPort
Expand Down
20 changes: 17 additions & 3 deletions internal/featuregates/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,23 @@
if err = json.Unmarshal(openAPISchemaBytes, &parsedV3Schema); err != nil {
return false, fmt.Errorf("failed to unmarshal openapi schema for %s: %w", resourcePath, err)
}
schemas := parsedV3Schema["components"].(map[string]interface{})["schemas"]
validatingWebhook := schemas.(map[string]interface{})["io.k8s.api.admissionregistration.v1.ValidatingWebhook"]
_, exists = validatingWebhook.(map[string]interface{})["properties"].(map[string]interface{})["matchConditions"]
components, ok := parsedV3Schema["components"].(map[string]interface{})
if !ok {
return false, fmt.Errorf("couldn't find components in openapi schema for %s", resourcePath)
}
schemas, ok := components["schemas"].(map[string]interface{})
if !ok {
return false, fmt.Errorf("couldn't find schemas in openapi schema for %s", resourcePath)
}
validatingWebhook, ok := schemas["io.k8s.api.admissionregistration.v1.ValidatingWebhook"].(map[string]interface{})
if !ok {
return false, fmt.Errorf("couldn't find schema for io.k8s.api.admissionregistration.v1.ValidatingWebhook in openapi schema for %s", resourcePath)
}
properties, ok := validatingWebhook["properties"].(map[string]interface{})
if !ok {
return false, fmt.Errorf("couldn't find properties in schema for io.k8s.api.admissionregistration.v1.ValidatingWebhook in openapi schema for %s", resourcePath)
}
_, exists = properties["matchConditions"]

Check warning on line 57 in internal/featuregates/featuregates.go

View check run for this annotation

Codecov / codecov/patch

internal/featuregates/featuregates.go#L41-L57

Added lines #L41 - L57 were not covered by tests

return exists, nil
}
Loading