Skip to content

Adjust runtime to properly support provider-kubernetes SSA#663

Merged
github-actions[bot] merged 2 commits intodevelopfrom
fix/provider_kubernetes_ssa
May 5, 2026
Merged

Adjust runtime to properly support provider-kubernetes SSA#663
github-actions[bot] merged 2 commits intodevelopfrom
fix/provider_kubernetes_ssa

Conversation

@TheBigLee
Copy link
Copy Markdown
Member

@TheBigLee TheBigLee commented Apr 30, 2026

Summary

  • This PR adjust the runtime as follows:
    • Remove empty fields from objects before putting them into the desired state
    • Adjust sts-observer object to not create it with the unnecessary spec fields

Checklist

  • Update tests.
  • Link this PR to related issues.
  • Merge with /merge comment.

Component PR: vshn/component-appcat#1168

@github-actions
Copy link
Copy Markdown
Contributor

@TheBigLee TheBigLee marked this pull request as ready for review May 4, 2026 09:47
@TheBigLee TheBigLee changed the title Fix/provider kubernetes ssa Adjust runtime to properly support provider-kubernetes SSA May 4, 2026
@TheBigLee TheBigLee requested review from a team, Kidswiss, mdnix, mikeshootzz and zugao and removed request for a team May 5, 2026 09:35
@TheBigLee TheBigLee force-pushed the fix/provider_kubernetes_ssa branch from 83a4c0f to 7d46c95 Compare May 5, 2026 10:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

// the fields needed to identify the object (apiVersion, kind, metadata).
// Use this for observer objects whose types contain non-omitempty fields (e.g. StatefulSet.spec.serviceName)
// that would otherwise be sent via server-side apply and fail immutability validation.
func KubeOptionObserveMinimalManifest(obj *xkube.Object) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would probably add this to the normal observe. Observe only needs the metadata anyway. Any observed state lands in the status.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed. Please check again

Copy link
Copy Markdown
Collaborator

@zugao zugao left a comment

Choose a reason for hiding this comment

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

LGTM

TheBigLee added 2 commits May 5, 2026 13:07
The empty spec fields cause issues with server-side-apply in
provider-kubernetes with StatefulSets as SSA wants to override the
already present and immutable fields. Since this is only used for
observing SSTs we don't need the spec at all, as the information in the
`metadata` is enough to identify the SST to observe
We might create objects with `nil` values in fields which can cause
issues with some CRs that expect a non-nil value. To fix that, we drop
any fields that have a `nil` value before putting the object into the
desired state
@TheBigLee TheBigLee force-pushed the fix/provider_kubernetes_ssa branch from 7d46c95 to a061e2b Compare May 5, 2026 11:07
@TheBigLee TheBigLee requested a review from Kidswiss May 5, 2026 11:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

@Kidswiss Kidswiss left a comment

Choose a reason for hiding this comment

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

LGTM

I'd advise to do one last round of testing though, since it's now used more broadly.

@TheBigLee
Copy link
Copy Markdown
Member Author

Tested it on lab and works without issues

@TheBigLee
Copy link
Copy Markdown
Member Author

/merge

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

@github-actions github-actions Bot merged commit 3039f6d into develop May 5, 2026
9 checks passed
@github-actions github-actions Bot deleted the fix/provider_kubernetes_ssa branch May 5, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants