Skip to content

Fix controller-runtime v0.23 Apply ambiguity#108

Merged
kdorosh merged 1 commit intoreddit:mainfrom
mfacenet:main
Feb 10, 2026
Merged

Fix controller-runtime v0.23 Apply ambiguity#108
kdorosh merged 1 commit intoreddit:mainfrom
mfacenet:main

Conversation

@mfacenet
Copy link
Copy Markdown
Contributor

Closes #

💸 TL;DR

This PR fixes controller-runtime v0.23+ compatibility in Achilles SDK by resolving ClientApplicator method ambiguity around Apply.
ClientApplicator embeds both client.Client and Applicator; newer controller-runtime adds Apply(...) on client.Client, causing ambiguous selector errors and interface mismatch when *ClientApplicator is passed as client.Client.
Fix is minimal: pass .Client where client.Client is required, and call .Applicator.Apply(...) where Achilles apply semantics are intended.

📜 Details

Design Doc (!-- N/A --)

Jira (!-- N/A --)

Compatibility issue observed:

  • Build failure on stacks using newer controller-runtime/k8s deps:
    • *io.ClientApplicator does not implement client.Client (ambiguous selector ... Apply)

Changes made:

  • pkg/fsm/types/transitions.go
    • Pass c.Client to functions expecting client.Client.
  • pkg/fsm/io/outputs.go
    • Use c.Applicator.Apply(...) for apply operations.
  • pkg/fsm/internal/reconciler.go
    • Pass r.client.Client to finalizer helpers expecting client.Client.
  • pkg/fsm/internal/reconciler_claim.go
    • Pass r.Client.Client to finalizer helpers.
    • Use r.Client.Applicator.Apply(...) where apply behavior is intended.
  • pkg/fsm/builder.go
    • Pass c.Client into Reconciler(...) where signature expects client.Client.

🧪 Testing Steps / Validation

  1. Reproduced compile failure before patch with a consumer using controller-runtime v0.23.x.
  2. Applied this patch set and re-ran consumer tests/build:
    • make test passed in consuming operator.
    • compile checks passed for affected packages.
  3. Verified changes are limited to client/applicator dispatch and type compatibility paths.

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

@mfacenet mfacenet requested a review from a team as a code owner February 10, 2026 02:40
@mfacenet mfacenet requested a review from kdorosh February 10, 2026 02:40
Copy link
Copy Markdown
Contributor

@kdorosh kdorosh left a comment

Choose a reason for hiding this comment

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

thanks for the contribution!

@kdorosh kdorosh merged commit 35ee787 into reddit:main Feb 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants