Skip to content

Conversation

@rmvangun
Copy link
Contributor

@rmvangun rmvangun commented Jun 1, 2025

This PR fixes issues with kustomization updates by switching to the dynamic client and properly handling suspend states. The previous implementation could fail during updates due to improper resource version handling and would reset suspend states.

Key changes:

  • Switch to dynamic client for proper resource version management
  • Add proper Group/Version/Resource parsing for API paths
  • Ensure atomic get-then-update operations for kustomizations
  • Remove redundant REST client code that could cause version conflicts
  • Preserve suspend state during kustomization updates

This change ensures that kustomization updates are handled correctly, preventing version conflicts and maintaining proper suspend states during reconciliation.

…rapper

This commit refactors applyKustomization to use the kubeClientResourceOperation wrapper exclusively, removing all direct dynamic client usage. This change ensures that all Kubernetes operations are mockable in tests, improving testability and maintainability. The wrapper handles resource versioning and error handling consistently, reducing duplication and potential bugs.
@rmvangun rmvangun self-assigned this Jun 1, 2025
@rmvangun rmvangun added the bug Something isn't working label Jun 1, 2025
@rmvangun rmvangun merged commit cd8cc58 into main Jun 1, 2025
12 of 13 checks passed
@rmvangun rmvangun deleted the fix/kustomization-race-condition branch June 1, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants