Although an App can have multiple staged and ready Droplets, it can only have one "desired" or "current" Droplet assigned at any given time. Clients can set the current droplet via the PATCH /v3/apps/:guid/relationships/current_droplet endpoint.
Acceptance Criteria
Aim to reach parity with the existing CF API. Cloud Controller has strict validations around ownership of the Droplet. If you try and set a Droplet that either does not exist or does not belong to the App it will return a 422 error. (relevant code)
Setting a Droplet (Happy Path)
GIVEN I have the shim running and a Droplet/App both exist in the same namespace and the Droplet is associated with the App
WHEN I make the following request
Setting a Droplet (Droplet exists and in correct namespace, but not owned by the App)
⚠️ Not sure how valuable this case is.
GIVEN I have the shim running and the Droplet does exist and is in the correct namespace, but is not Associated with the App
WHEN I make the following request
Context
Although an App can have multiple staged and ready Droplets, it can only have one "desired" or "current" Droplet assigned at any given time. Clients can set the current droplet via the
PATCH /v3/apps/:guid/relationships/current_droplet
endpoint.Acceptance Criteria
Aim to reach parity with the existing CF API. Cloud Controller has strict validations around ownership of the Droplet. If you try and set a Droplet that either does not exist or does not belong to the App it will return a
422
error. (relevant code)Setting a Droplet (Happy Path)
GIVEN I have the shim running and a Droplet/App both exist in the same namespace and the Droplet is associated with the App WHEN I make the following request
THEN I see the following response
AND I can view the App CR and see that its
currentDropletRef
points to the Droplet I specifiedSetting a Droplet (App does not exist)
GIVEN I have the shim running and the App does not exist WHEN I make the following request
THEN I receive a
404
response with the error in the body (see what happens on CF for VMs today)Setting a Droplet (Droplet does not exist)
GIVEN I have the shim running and the Droplet does not exist WHEN I make the following request
THEN I receive a
422
response with the error in the body (see what happens on CF today)Setting a Droplet (Droplet exists but not in namespace for the App)
GIVEN I have the shim running and the Droplet does exist but is in a different namespace from the App WHEN I make the following request
THEN I receive a
422
response with the error in the body (see what happens on CF today)Setting a Droplet (Droplet exists and in correct namespace, but not owned by the App)
⚠️ Not sure how valuable this case is.
GIVEN I have the shim running and the Droplet does exist and is in the correct namespace, but is not Associated with the App WHEN I make the following request
THEN I receive a
422
response with the error in the body (see what happens on CF today)Dev Notes