Skip to content

Migrate from deprecated fakeclient.NewSimpleClientset to NewClientset #2400

@ArangoGutierrez

Description

@ArangoGutierrez

Summary

With the upgrade to k8s.io/client-go v0.35.0 (PR #2396), fakeclient.NewSimpleClientset is now deprecated in favor of NewClientset.

The deprecation message states:

NewClientset replaces this with support for field management, which significantly improves server side apply testing. NewClientset is only available when apply configurations are generated (e.g. via --with-applyconfig).

Affected Files

The following files have //nolint:staticcheck directives that should be removed once the migration is complete:

  • pkg/nfd-master/nfd-api-controller_test.go
  • pkg/nfd-master/nfd-master-internal_test.go
  • pkg/nfd-master/nfd-master_test.go
  • pkg/nfd-master/updater-pool_test.go
  • pkg/nfd-worker/nfd-worker-internal_test.go
  • pkg/nfd-worker/nfd-worker_test.go
  • pkg/resourcemonitor/podresourcesscanner_test.go (file-level nolint directive)

Required Work

  1. Generate apply configurations for the fake client (requires --with-applyconfig flag in code generation)
  2. Replace all fakeclient.NewSimpleClientset() calls with fakeclient.NewClientset()
  3. Remove all //nolint:staticcheck directives added in PR build(deps): bump the k8sio group across 1 directory with 2 updates #2396

References

/kind cleanup
/priority backlog

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions