Skip to content

Upgrade k8s client-go to 0.27 via controller-runtime upgrade #6678

Open
@absoludity

Description

@absoludity

Summary
We have a bunch of auto-upgrades that we've been closing because of an issue upgrading our k8s deps past 0.26, where the lint errors with

  Running [/home/runner/golangci-lint-1.54.2-linux-amd64/golangci-lint run --out-format=github-actions --timeout=10m] in [] ...
  Error: cannot use &withWatchWrapper{} (value of type *withWatchWrapper) as "sigs.k8s.io/controller-runtime/pkg/client".WithWatch value in variable declaration: *withWatchWrapper does not implement "sigs.k8s.io/controller-runtime/pkg/client".WithWatch (missing method GroupVersionKindFor) (typecheck)
  Error: cannot use &ctrlClient (value of type *withWatchWrapper) as "sigs.k8s.io/controller-runtime/pkg/client".WithWatch value in argument to clientgetter.NewBuilder().WithApiExt(apiExtClient).WithTyped(typedClient).WithControllerRuntime: *withWatchWrapper does not implement "sigs.k8s.io/controller-runtime/pkg/client".WithWatch (missing method GroupVersionKindFor) (typecheck)
  Error: cannot use &ctrlClient (value of type *withWatchWrapper) as "sigs.k8s.io/controller-runtime/pkg/client".WithWatch value in argument to clientgetter.NewBuilder().WithApiExt(apiExtClient).WithTyped(typedClient).WithControllerRuntime: *withWatchWrapper does not implement "sigs.k8s.io/controller-runtime/pkg/client".WithWatch (missing method GroupVersionKindFor) (typecheck)
  Error: cannot use &ctrlClient (value of type *withWatchWrapper) as "sigs.k8s.io/controller-runtime/pkg/client".WithWatch value in argument to clientgetter.NewBuilder().WithApiExt(apiExtClient).WithTyped(typedClient).WithControllerRuntime: *withWatchWrapper does not implement "sigs.k8s.io/controller-runtime/pkg/client".WithWatch (missing method GroupVersionKindFor) (typecheck)
  Error: impossible type assertion: ctrlClient.(*withWatchWrapper)
  	*withWatchWrapper does not implement "sigs.k8s.io/controller-runtime/pkg/client".WithWatch (missing method GroupVersionKindFor) (typecheck)
  Error: SA1019: wait.PollImmediateWithContext is deprecated: This method does not return errors from context, use PollWithContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release.  (staticcheck)

We need to spend some time to upgrade controller-runtime first, and once upgraded, from what I can see, the rest should follow more smoothly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/project(To be removed)kind/enhancementAn issue that reports an enhancement for an implemented feature

    Type

    No type

    Projects

    Status

    🗂 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions