Skip to content

Bump dependencies and fix deprecated API usage#1032

Merged
zeeke merged 1 commit intok8snetworkplumbingwg:masterfrom
SchSeba:bump-dependencies-pr1027
Feb 17, 2026
Merged

Bump dependencies and fix deprecated API usage#1032
zeeke merged 1 commit intok8snetworkplumbingwg:masterfrom
SchSeba:bump-dependencies-pr1027

Conversation

@SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Feb 15, 2026

Bump Go module dependencies (from PR #1027):

  • github.com/jaypipes/ghw v0.21.2 -> v0.22.0
  • github.com/onsi/ginkgo/v2 v2.27.3 -> v2.28.1
  • github.com/onsi/gomega v1.38.3 -> v1.39.0
  • github.com/coreos/go-systemd/v22 v22.6.0 -> v22.7.0
  • github.com/google/renameio/v2 v2.0.1 -> v2.0.2
  • github.com/prometheus-operator/prometheus-operator v0.87.1 -> v0.89.0
  • sigs.k8s.io/controller-runtime v0.22.4 -> v0.23.1
  • k8s.io/api, apimachinery, client-go, etc. v0.34.3 -> v0.35.0
  • Various indirect dependency bumps (golang.org/x/*, etc.)

Fix compilation and lint issues caused by the bumps:

  • openstack_test.go: ghw v0.22.0 changed ghw.Network function signature from func(opts ...*option.Option) to func(args ...any). Update the test mock and remove unused github.com/jaypipes/ghw/pkg/option import.

  • drain_controller*.go, main.go: controller-runtime v0.23.1 deprecated GetEventRecorderFor (old events API). Migrate to GetEventRecorder (new events API) and update recorder.Event() calls to recorder.Eventf() with the new events.EventRecorder interface signature.

  • service.go: go-systemd v22.7.0 deprecated unit.Deserialize. Replace with unit.DeserializeOptions (drop-in replacement).

Signed-off-by: sriov-network-operator maintainers

Bump Go module dependencies (from PR k8snetworkplumbingwg#1027):
- github.com/jaypipes/ghw v0.21.2 -> v0.22.0
- github.com/onsi/ginkgo/v2 v2.27.3 -> v2.28.1
- github.com/onsi/gomega v1.38.3 -> v1.39.0
- github.com/coreos/go-systemd/v22 v22.6.0 -> v22.7.0
- github.com/google/renameio/v2 v2.0.1 -> v2.0.2
- github.com/prometheus-operator/prometheus-operator v0.87.1 -> v0.89.0
- sigs.k8s.io/controller-runtime v0.22.4 -> v0.23.1
- k8s.io/api, apimachinery, client-go, etc. v0.34.3 -> v0.35.0
- Various indirect dependency bumps (golang.org/x/*, etc.)

Fix compilation and lint issues caused by the bumps:

- openstack_test.go: ghw v0.22.0 changed ghw.Network function signature
  from func(opts ...*option.Option) to func(args ...any). Update the
  test mock and remove unused github.com/jaypipes/ghw/pkg/option import.

- drain_controller*.go, main.go: controller-runtime v0.23.1 deprecated
  GetEventRecorderFor (old events API). Migrate to GetEventRecorder
  (new events API) and update recorder.Event() calls to recorder.Eventf()
  with the new events.EventRecorder interface signature.

- service.go: go-systemd v22.7.0 deprecated unit.Deserialize. Replace
  with unit.DeserializeOptions (drop-in replacement).

Signed-off-by: sriov-network-operator maintainers
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@github-actions github-actions bot added the tests label Feb 15, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @SchSeba, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on maintaining the project's health and compatibility by updating its Go module dependencies. These updates necessitated several code modifications to adapt to new API signatures and deprecated functions in controller-runtime, go-systemd, and ghw, ensuring the application remains functional and up-to-date with its underlying libraries.

Highlights

  • Dependency Updates: Multiple Go module dependencies have been bumped to their latest versions, including ghw, ginkgo/v2, gomega, go-systemd/v22, renameio/v2, prometheus-operator, controller-runtime, and various Kubernetes core libraries (k8s.io/api, apimachinery, client-go).
  • Deprecated API Migration (controller-runtime): The deprecated GetEventRecorderFor function from sigs.k8s.io/controller-runtime has been replaced with GetEventRecorder. Additionally, event recording calls have been updated from recorder.Event() to recorder.Eventf() to align with the new events.EventRecorder interface.
  • Deprecated API Migration (go-systemd): The deprecated unit.Deserialize function from github.com/coreos/go-systemd/v22 has been replaced with unit.DeserializeOptions.
  • ghw API Adaptation: The ghw.Network function signature in pkg/platform/openstack/openstack_test.go was updated to reflect changes in ghw v0.22.0, moving from func(opts ...*option.Option) to func(args ...any).
Changelog
  • controllers/drain_controller.go
    • Updated event recorder type from record.EventRecorder to events.EventRecorder.
  • controllers/drain_controller_helper.go
    • Updated event recording calls from recorder.Event to recorder.Eventf with an additional argument for the event reason.
  • controllers/drain_controller_test.go
    • Updated k8sManager.GetEventRecorderFor to k8sManager.GetEventRecorder.
  • go.mod
    • Updated github.com/coreos/go-systemd/v22 from v22.6.0 to v22.7.0.
    • Updated github.com/google/renameio/v2 from v2.0.1 to v2.0.2.
    • Updated github.com/jaypipes/ghw from v0.21.2 to v0.22.0.
    • Updated github.com/onsi/ginkgo/v2 from v2.27.3 to v2.28.1.
    • Updated github.com/onsi/gomega from v1.38.3 to v1.39.0.
    • Updated github.com/prometheus-operator/prometheus-operator from v0.87.1 to v0.89.0.
    • Updated k8s.io/api, apiextensions-apiserver, apimachinery, client-go, code-generator, kubectl from v0.34.3 to v0.35.0.
    • Updated sigs.k8s.io/controller-runtime from v0.22.4 to v0.23.1.
    • Updated various indirect golang.org/x/* dependencies.
  • go.sum
    • Updated checksums for all bumped direct and indirect dependencies.
  • main.go
    • Updated mgr.GetEventRecorderFor to mgr.GetEventRecorder.
  • pkg/host/internal/service/service.go
    • Replaced unit.Deserialize with unit.DeserializeOptions in CompareServices and UpdateSystemService functions.
  • pkg/platform/openstack/openstack_test.go
    • Removed unused import github.com/jaypipes/ghw/pkg/option.
    • Updated the mock ghw.Network function signature from func(opts ...*option.Option) to func(args ...any).
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively updates various Go module dependencies and addresses the resulting deprecated API usage. The migration from the old events API (record.Event) to the new one (events.Eventf) is well-executed across the controllers. Similarly, the replacement of deprecated functions like ghw.Network, unit.Deserialize, and GetEventRecorderFor is correct. I've identified a couple of minor issues where EventTypeWarning is used for success events, which should be EventTypeNormal for better clarity in event logs. Overall, this is a solid update that keeps the codebase current.

Comment on lines +57 to 61
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeWarning,
"DrainController",
"CompleteDrain",
"node un drain completed")

Choose a reason for hiding this comment

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

medium

Using corev1.EventTypeNormal for successful operations like this one improves observability. It helps operators distinguish between normal operational events and actual warnings that might require attention.

Suggested change
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeWarning,
"DrainController",
"CompleteDrain",
"node un drain completed")
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeNormal,
"DrainController",
"CompleteDrain",
"node un drain completed")

Comment on lines +138 to 142
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeWarning,
"DrainController",
"DrainNode",
"node drain completed")

Choose a reason for hiding this comment

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

medium

To maintain clear and actionable event logs, successful operations should generate corev1.EventTypeNormal events. Using corev1.EventTypeWarning here could create unnecessary noise for monitoring systems.

Suggested change
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeWarning,
"DrainController",
"DrainNode",
"node drain completed")
dr.recorder.Eventf(nodeNetworkState, nil,
corev1.EventTypeNormal,
"DrainController",
"DrainNode",
"node drain completed")

@coveralls
Copy link

Pull Request Test Coverage Report for Build 22033594101

Details

  • 7 of 17 (41.18%) changed or added relevant lines in 3 files are covered.
  • 89 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.6%) to 62.89%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/host/internal/service/service.go 0 4 0.0%
controllers/drain_controller_helper.go 6 12 50.0%
Files with Coverage Reduction New Missed Lines %
controllers/helper.go 1 70.45%
controllers/drain_controller.go 4 79.53%
api/v1/zz_generated.deepcopy.go 84 38.49%
Totals Coverage Status
Change from base Build 21902252428: -0.6%
Covered Lines: 9304
Relevant Lines: 14794

💛 - Coveralls

@zeeke zeeke merged commit 0756e35 into k8snetworkplumbingwg:master Feb 17, 2026
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants