Handle resource already exist when setting up Admiralty #3

Closed
opened 2025-04-09 18:15:59 +02:00 by pb · 2 comments
Owner

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.

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.
Author
Owner

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.

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.
Author
Owner

Implemented the k8s.io/client-go/dynamic.DynamicClient to interact with the specific API necessary for Admiralty. We can then use Apply() to have an idempotent creation of ressources.

Implemented the `k8s.io/client-go/dynamic.DynamicClient` to interact with the specific API necessary for Admiralty. We can then use `Apply()` to have an idempotent creation of ressources.
pb closed this issue 2025-04-11 16:02:26 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: core/oc-monitord#3
No description provided.