-
Notifications
You must be signed in to change notification settings - Fork 1
Description
There are at least two race conditions when creating a cluster:
- API returns 409 "conflict" with body '{"reason":"Operation cannot be fulfilled on clusters.syn.tools 'c-unicornfarts2': the object has been modified; please apply your changes to the latest version and try again"}' or similar
- API returns new cluster object without the installURL being set
I assume the two problems are related.
Steps to Reproduce the Problem
Create a cluster with valid data, e.g. the problem has been reproduced by POSTing
{"id":"c-unicornfarts7","displayName":"Unicorn FARTS 7!","annotations":{},"tenant":"t-sg-test","facts":{"cloud":"c","service_level":"best_effort","access_policy":"regular","release_channel":"a","sales_order":"NONE","distribution":"b"},"gitRepo":{"type":"auto"}}
to /clusters.
Being a race condition the problem is hard to reproduce reliably.
Actual Behavior
Sometimes it works, sometimes I get back a cluster that doesn't have an installURL, sometimes I get back a 409 conflict with body {"reason":"Operation cannot be fulfilled on clusters.syn.tools 'c-unicornfarts7': the object has been modified; please apply your changes to the latest version and try again"}
Expected Behavior
I reliably get back a cluster object with installURL set.
Moreover the 409 response code does not appear in https://syn.tools/lieutenant-api/references/index.html#_createcluster . Whether that's an implementation bug or a documentation bug I don't know, but it should be fixed one way or another.