Handle resource already exist when setting up Admiralty #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Modify the code returned if the resource already exists (target and source) and allow secrets to be recreated.
The secrets only have 1 hour duration, once expired the target node is no longer usable.
TODO : use apply and/or Put from the k8s go client.
Managed to use apply for the Secret used by the Source, but the k8s (maybe k3s) API didn't respond positively to the Put request I tried with Targets.
I've handled the 409 response code to Post in
oc-datacenterwith a specific condition in the error handling, but it would be better to implement Put request with the go client's RESTClient, so that interactions are idempotent.Implemented the
k8s.io/client-go/dynamic.DynamicClientto interact with the specific API necessary for Admiralty. We can then useApply()to have an idempotent creation of ressources.