You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what should be investigated or refactored
We have a couple of places in Zarf where we need to do a create or update on a resource. This is handled in a couple of different ways currently. Either the resource is deleted first and then created. Alternatively we use a verbose logic to try creating and falling back to an update if the resource already exists.
A much better way is to switch over to SSA instead. This moves any responsibility to the API server instead, removing any need for us to deal with checking if a resource exists or not first
Describe what should be investigated or refactored
We have a couple of places in Zarf where we need to do a create or update on a resource. This is handled in a couple of different ways currently. Either the resource is deleted first and then created. Alternatively we use a verbose logic to try creating and falling back to an update if the resource already exists.
A much better way is to switch over to SSA instead. This moves any responsibility to the API server instead, removing any need for us to deal with checking if a resource exists or not first
Links to any relevant code
https://github.com/defenseunicorns/zarf/blob/7415967772410ceeb77aae7b61367dad85b1516f/src/pkg/cluster/state.go#L114-L127
Additional context
https://kubernetes.io/docs/reference/using-api/server-side-apply/
https://kubernetes.io/blog/2022/10/20/advanced-server-side-apply/
The text was updated successfully, but these errors were encountered: