Skip to content

Comments

use native SSA support (controller-runtime v0.22) and remove unstructured conversion#875

Merged
yamatcha merged 2 commits intomainfrom
native-ssa
Feb 4, 2026
Merged

use native SSA support (controller-runtime v0.22) and remove unstructured conversion#875
yamatcha merged 2 commits intomainfrom
native-ssa

Conversation

@arosh
Copy link
Member

@arosh arosh commented Jan 29, 2026

Summary

This PR updates the code to use native Server-Side Apply (SSA) support introduced in controller-runtime v0.22, eliminating the previously required conversion to unstructured objects.

Background

In controller-runtime v0.22, kubernetes-sigs/controller-runtime#3253 introduced the ability for the client.Apply method to accept runtime.ApplyConfiguration directly. This eliminates the need for:

  • Converting objects via runtime.DefaultUnstructuredConverter.ToUnstructured()
  • Creating wrappers with client.ApplyConfigurationFromUnstructured()

Changes

  • Updated the apply function signature to accept runtime.ApplyConfiguration directly
  • Removed unstructured conversion logic

These changes make the code simpler and improve type safety.

References

@arosh arosh marked this pull request as ready for review January 29, 2026 01:19
@arosh arosh requested a review from Copilot January 30, 2026 04:31
Copy link
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 modernizes the codebase to leverage native Server-Side Apply (SSA) support introduced in controller-runtime v0.22, eliminating the need for manual conversion to unstructured objects before applying Kubernetes resources.

Changes:

  • Updated the apply function to accept runtime.ApplyConfiguration directly instead of a generic type
  • Removed unstructured object conversion logic from both the apply function and reconcileV1StatefulSet method
  • Simplified type parameter syntax in ptr.To calls

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

yamatcha
yamatcha previously approved these changes Jan 30, 2026
Co-authored-by: Soju Yamashita <soju-yamashita@cybozu.co.jp>
@yamatcha yamatcha merged commit 959ba91 into main Feb 4, 2026
21 checks passed
@yamatcha yamatcha deleted the native-ssa branch February 4, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants