Handle resource already exist when setting up Admiralty #3
Labels
No Label
Kind/Bug
Kind/Doc
Kind/Feature
Kind/Security
Kind/Testing
Priority/High
Priority/Low
Priority/Medium
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: core/oc-monitord#3
Loading…
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-datacenter
with 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.DynamicClient
to interact with the specific API necessary for Admiralty. We can then useApply()
to have an idempotent creation of ressources.