Skip to content

chore(deps): Update controller-runtime from v0.23.3 to v0.24.0 and k8s dependencie to support k8s 1.36#1804

Open
dongjiang1989 wants to merge 1 commit intokagent-dev:mainfrom
dongjiang1989:controller-runtime-v0.24
Open

chore(deps): Update controller-runtime from v0.23.3 to v0.24.0 and k8s dependencie to support k8s 1.36#1804
dongjiang1989 wants to merge 1 commit intokagent-dev:mainfrom
dongjiang1989:controller-runtime-v0.24

Conversation

@dongjiang1989
Copy link
Copy Markdown
Contributor

Description

Upgrade controller-runtime from v0.23.3 to v0.24.0 and k8s dependencies to support k8s 1.26

Changes required:

⚠️ controller-runtime v0.24.0 deprecated scheme.Builder:

// Deprecated: This helper is only useful in api packages, but api packages                     
// should be easy to import and hence have minimal dependencies.                                
type Builder struct { ... }                                                                     

Solution

Replace deprecated sigs.k8s.io/controller-runtime/pkg/scheme.Builder with
k8s.io/apimachinery/pkg/runtime.NewSchemeBuilder() in scaffolding templates.

Before:

import "sigs.k8s.io/controller-runtime/pkg/scheme"
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

After:

import "k8s.io/apimachinery/pkg/runtime"                                                        
SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error {                   
   metav1.AddToGroupVersion(scheme, SchemeGroupVersion)                     
   return nil                                                                                  
})            

This reduces API package dependencies and follows Kubernetes core API patterns.

…s to support k8s 1.26

Signed-off-by: dongjiang <dongjiang1989@126.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades Kubernetes/controller-runtime Go dependencies and updates the API scaffolding to remove usage of the deprecated sigs.k8s.io/controller-runtime/pkg/scheme.Builder, aligning the API packages with the upstream Kubernetes runtime.SchemeBuilder pattern. It also regenerates CRD manifests/templates to reflect the updated dependency schema metadata.

Changes:

  • Bump sigs.k8s.io/controller-runtime to v0.24.0 and update k8s.io/* module versions accordingly (plus related dependency refresh in go.sum).
  • Replace deprecated controller-runtime scheme.Builder usage with k8s.io/apimachinery/pkg/runtime.NewSchemeBuilder and update type registration to AddKnownTypes(...).
  • Regenerate CRD YAMLs (both go/api/config/crd/bases and Helm CRD templates), updating description text based on the newer schema source.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
helm/kagent-crds/templates/kagent.dev_sandboxagents.yaml Regenerated Helm CRD template; description text updated to match newer schema.
helm/kagent-crds/templates/kagent.dev_agents.yaml Regenerated Helm CRD template; description text updated to match newer schema.
go/go.mod Bumps controller-runtime and k8s module versions; adds direct apiextensions-apiserver requirement; updates x/exp + other deps.
go/go.sum Refreshes dependency checksums to match go.mod updates (ginkgo/gomega, otelgrpc, k8s libs, etc.).
go/api/v1alpha2/zz_generated.deepcopy.go Gofmt-style import cleanup (remove redundant import alias).
go/api/v1alpha2/sandboxagent_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha2/remotemcpserver_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha2/modelproviderconfig_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha2/modelconfig_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha2/groupversion_info.go Replace controller-runtime scheme builder with runtime.NewSchemeBuilder + metav1.AddToGroupVersion.
go/api/v1alpha2/agent_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha1/zz_generated.deepcopy.go Gofmt-style import cleanup (remove redundant import alias).
go/api/v1alpha1/toolserver_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha1/modelconfig_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha1/memory_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/v1alpha1/groupversion_info.go Replace controller-runtime scheme builder with runtime.NewSchemeBuilder + metav1.AddToGroupVersion.
go/api/v1alpha1/agent_types.go Switch type registration to runtime.SchemeBuilder function-based registration.
go/api/config/crd/bases/kagent.dev_sandboxagents.yaml Regenerated CRD base manifest; description text updated to match newer schema.
go/api/config/crd/bases/kagent.dev_agents.yaml Regenerated CRD base manifest; description text updated to match newer schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go/go.mod
@dongjiang1989 dongjiang1989 changed the title chore(deps): Update controller-runtime from v0.23.3 to v0.24.0 and k8s dependencie to support k8s 1.26 chore(deps): Update controller-runtime from v0.23.3 to v0.24.0 and k8s dependencie to support k8s 1.36 May 6, 2026
@dongjiang1989
Copy link
Copy Markdown
Contributor Author

cc @EItanya PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants