Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.25-openshift-4.22
tag: rhel-9-release-golang-1.26-openshift-5.0
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 golang:1.25 as builder
FROM golang:1.26 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.daemon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.25 AS builder
FROM golang:1.26 AS builder
WORKDIR /go/src/github.com/openshift/ingress-node-firewall
COPY . .

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.daemon.openshift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder

WORKDIR /go/src/github.com/openshift/ingress-node-firewall
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.openshift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder

WORKDIR /workspace

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif
IMG ?= quay.io/openshift/origin-ingress-node-firewall:latest
DAEMON_IMG ?= quay.io/openshift/origin-ingress-node-firewall-daemon:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.32.x
ENVTEST_K8S_VERSION = 1.36

# Default namespace
NAMESPACE ?= ingress-node-firewall-system
Expand Down Expand Up @@ -419,7 +419,7 @@ catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)

CILIUM_EBPF_VERSION := v0.18.0
GOLANGCI_LINT_VERSION = v1.54.2
GOLANGCI_LINT_VERSION = v1.64.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Is golangci-lint v1.64.8 compatible with Go 1.26 and what are the major changes since v1.54.2?

💡 Result:

Golangci-lint v1.64.8 is not compatible with Go 1.26 [1][2]. Compatibility for golangci-lint is strictly tied to the Go version used to build the binary [2]. Because v1.64.8 was released on March 17, 2025 [3][4], well before the support for Go 1.26 was introduced in later versions of the tool (which required explicit updates to build workflows and internal configurations) [5][6], it cannot properly analyze code targeting Go 1.26 [1]. If you attempt to use v1.64.8 with Go 1.26, you will likely encounter errors stating that the Go version used to build the linter is lower than the targeted Go version [1]. Regarding major changes since v1.54.2, the project has seen significant evolution, including: 1. Support for newer Go versions: Successive releases added support for subsequent Go versions (e.g., Go 1.22 through Go 1.26) [5][6]. 2. Linter updates and consolidation: Many individual linters have been updated, and in some cases, merged or consolidated to improve performance and consistency (e.g., merging staticcheck, stylecheck, and gosimple into a single linter) [7][8]. 3. Configuration enhancements: Changes have been introduced to improve configuration management, including detecting and handling configuration files from newer major versions of the tool [4][9]. 4. Deprecations: Several linters have been deprecated as better alternatives or built-in functionality were introduced [7][10]. For continued support with modern Go environments, you should upgrade to a version of golangci-lint that explicitly supports your targeted Go version [5][2].

Citations:


Fix golangci-lint Go 1.26 compatibility (Makefile GOLANGCI_LINT_VERSION)
golangci-lint v1.64.8 is not compatible with Go 1.26 because compatibility is tied to the Go version used to build the linter binary, and v1.64.8 predates Go 1.26 support. Update GOLANGCI_LINT_VERSION to a release that explicitly supports Go 1.26, and check the golangci-lint changelog between v1.54.2 → v1.64.8 for linter/rule/config changes that may require config adjustments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 422, Update GOLANGCI_LINT_VERSION in the Makefile because
v1.64.8 is not built with Go 1.26 compatibility; set the GOLANGCI_LINT_VERSION
variable to a golangci-lint release that explicitly lists Go 1.26 support (pick
the latest release that declares Go 1.26 compatibility) and update the Makefile
accordingly; after changing GOLANGCI_LINT_VERSION, review the golangci-lint
changelog between v1.54.2 and v1.64.8 for any rule/config changes and adjust
your .golangci.yml (or linter config) or CI commands to accommodate
renamed/removed linters or new defaults.

CLANG ?= clang
CFLAGS := -O2 -g -Wall -Werror $(CFLAGS)
GOOS ?= linux
Expand Down
8 changes: 6 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ limitations under the License.
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "ingressnodefirewall.openshift.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
SchemeBuilder = runtime.NewSchemeBuilder(func(s *runtime.Scheme) error {
metav1.AddToGroupVersion(s, GroupVersion)
return nil
})

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
Expand Down
6 changes: 5 additions & 1 deletion api/v1alpha1/ingressnodefirewall_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)

Expand Down Expand Up @@ -200,5 +201,8 @@ type IngressNodeFirewallList struct {
}

func init() {
SchemeBuilder.Register(&IngressNodeFirewall{}, &IngressNodeFirewallList{})
SchemeBuilder.Register(func(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion, &IngressNodeFirewall{}, &IngressNodeFirewallList{})
return nil
})
}
6 changes: 5 additions & 1 deletion api/v1alpha1/ingressnodefirewallconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// IngressNodeFirewallConfigSpec defines the desired state of IngressNodeFirewallConfig.
Expand Down Expand Up @@ -70,5 +71,8 @@ type IngressNodeFirewallConfigList struct {
}

func init() {
SchemeBuilder.Register(&IngressNodeFirewallConfig{}, &IngressNodeFirewallConfigList{})
SchemeBuilder.Register(func(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion, &IngressNodeFirewallConfig{}, &IngressNodeFirewallConfigList{})
return nil
})
}
6 changes: 5 additions & 1 deletion api/v1alpha1/ingressnodefirewallnodestate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
Expand Down Expand Up @@ -73,5 +74,8 @@ type IngressNodeFirewallNodeStateList struct {
}

func init() {
SchemeBuilder.Register(&IngressNodeFirewallNodeState{}, &IngressNodeFirewallNodeStateList{})
SchemeBuilder.Register(func(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion, &IngressNodeFirewallNodeState{}, &IngressNodeFirewallNodeStateList{})
return nil
})
}
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions controllers/ingressnodefirewall_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ func (r *IngressNodeFirewallReconciler) Reconcile(ctx context.Context, req ctrl.
}
if yes, debugMode, err := r.isUsingBpfmanManager(ctx); yes && err == nil {
r.Log.Info("BPFMAN: Deleting ebpf program", "req.Name", req.Name)
interfaces := make([]string, 0,
len(ingressNodeFirewallCurrentNodeState.Spec.InterfaceIngressRules))
for intf := range ingressNodeFirewallCurrentNodeState.Spec.InterfaceIngressRules {
interfaces = append(interfaces, intf)
}
if err := bpf_mgr.BpfmanDetachNodeFirewall(ctx, r.Client, nil, debugMode); err != nil {
r.Log.Error(err, "Failed to delete ebpf program", "req.Name", req.Name)
return ctrl.Result{}, err
Expand Down Expand Up @@ -368,7 +363,7 @@ func (r *IngressNodeFirewallReconciler) buildNodeStates(
r.Log.Info("BPFMAN: Creating application object and attach ingress firewall prog")
err = bpf_mgr.BpfmanAttachNodeFirewall(ctx, r.Client, firewallObj, debugMode)
if err != nil {
errMsg := fmt.Sprintf("BPFMAN: Failed to attach ingress firewall prog")
errMsg := "BPFMAN: Failed to attach ingress firewall prog"
r.Log.Error(err, errMsg)
if !strings.Contains(err.Error(), programAlreadyExistsErr) {
state.Status = infv1alpha1.IngressNodeFirewallNodeStateStatus{
Expand Down
3 changes: 3 additions & 0 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"
"path/filepath"
"testing"
"time"

//+kubebuilder:scaffold:imports
ingressnodefwv1alpha1 "github.com/openshift/ingress-node-firewall/api/v1alpha1"
Expand Down Expand Up @@ -57,6 +58,8 @@ var testEnv *envtest.Environment

func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)
SetDefaultEventuallyTimeout(5 * time.Second)
SetDefaultEventuallyPollingInterval(100 * time.Millisecond)

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
Expand Down
114 changes: 62 additions & 52 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
module github.com/openshift/ingress-node-firewall

go 1.25.0
go 1.26.0

require (
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/bpfman/bpfman-operator v0.5.7-0.20250318195503-7377aa509673
github.com/cilium/ebpf v0.18.0
github.com/go-logr/logr v1.4.2
github.com/go-logr/logr v1.4.3
github.com/golang/glog v1.2.5
github.com/google/gopacket v1.1.19
github.com/kennygrant/sanitize v1.2.4
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.37.0
github.com/onsi/gomega v1.39.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.22.0
github.com/prometheus/common v0.63.0
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa
golang.org/x/sys v0.32.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.67.5
github.com/vishvananda/netlink v1.3.1
golang.org/x/sys v0.40.0
gopkg.in/mcuadros/go-syslog.v2 v2.3.0
k8s.io/api v0.32.3
k8s.io/apiextensions-apiserver v0.32.3
k8s.io/apimachinery v0.32.3
k8s.io/client-go v0.32.3
k8s.io/component-base v0.32.3
k8s.io/api v0.36.1
k8s.io/apiextensions-apiserver v0.36.1
k8s.io/apimachinery v0.36.1
k8s.io/client-go v0.36.1
k8s.io/component-base v0.36.1
k8s.io/klog v1.0.0
k8s.io/kubernetes v1.32.3
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
sigs.k8s.io/controller-runtime v0.20.4
k8s.io/kubernetes v1.36.1
k8s.io/utils v0.0.0-20260507154919-ff6756f316d2
sigs.k8s.io/controller-runtime v0.24.1
)

require (
Expand All @@ -36,62 +36,72 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/go-openapi/swag v0.25.4 // indirect
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/mangling v0.25.4 // indirect
github.com/go-openapi/swag/netutils v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/spdystream v0.5.0 // indirect
github.com/moby/spdystream v0.5.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // 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/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/vishvananda/netns v0.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.7.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/term v0.39.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.14.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
k8s.io/apiserver v0.36.1 // indirect
k8s.io/controller-manager v0.36.1 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260603220949-865597e52e25 // indirect
k8s.io/streaming v0.36.1 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
Loading