fix(redis, rabbitmq): pass region and instance ID in the correct order on update - #1681
Open
johannes-engler-mw wants to merge 2 commits into
Conversation
…r on update
PartialUpdateInstance in the redis and rabbitmq SDKs is declared as
(ctx, projectId, regionId, instanceId), but both resources called it as
(ctx, projectId, instanceId, region). Both parameters are strings, so
the transposition compiles cleanly and only surfaces at runtime: the
instance UUID is interpolated into the {regionId} path segment, and the
API rejects the request with
status code 400, Body: Bad Request: Invalid region specified.
Every other call in the same two files — including the
PartialUpdateInstanceWaitHandler a few lines below the defect — already
passes (projectId, region, instanceId).
This makes every in-place update of stackit_redis_instance and
stackit_rabbitmq_instance fail, not only changes to `parameters`.
The other services calling PartialUpdateInstance were checked against
their own SDK signatures and are correct: logme, mariadb, opensearch,
postgresflex and sqlserverflex take (projectId, region, instanceId),
while mongodbflex's SDK genuinely declares (projectId, instanceId,
region) and is called accordingly.
relates to stackitcloud#1677
Author
|
@GokceGK Any update when this will be released? Its blocking our whole infra deployments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
relates to #1677
PartialUpdateInstanceis declared in the redis and rabbitmq SDKs as(ctx, projectId, regionId, instanceId), but both resources call it as(ctx, projectId, instanceId, region). Both parameters arestring, so the transposition compiles cleanly and only shows up at runtime.The SDK interpolates positionally into the path template:
so the instance UUID ends up in the
{regionId}segment and the API rejects it:Every other call in the same two files already passes
(projectId, region, instanceId)— including thePartialUpdateInstanceWaitHandlera few lines below each defect, which is what makes the two call sites look correct at a glance.Impact
This breaks every in-place update of
stackit_redis_instanceandstackit_rabbitmq_instance, not only changes toparameters. #1677 reports it viamaxmemory_policy, butsgw_aclgoes through the same call, so ACL changes are equally affected.Worth noting for anyone hitting #1677: setting
regionexplicitly in the configuration works around the plan-time symptom (the spurious force-replacement), but not this — the value is still passed into the wrong parameter slot at apply time.Scope
I checked every service calling
PartialUpdateInstanceagainst its own SDK signature, since the argument order legitimately differs between SDKs. Only these two are wrong:(projectId, instanceId, region)(projectId, regionId, instanceId)(projectId, instanceId, region)(projectId, regionId, instanceId)(projectId, instanceId, region)(projectId, instanceId, region)(projectId, region, instanceId)(projectId, region/regionId, instanceId)mongodbflexlooks like the same shape but its SDK genuinely declares(projectId, instanceId, region), so it is correct as written.Checklist
make fmtexamples/directory) — not applicable, no schema or usage changemake generate-docs(will be checked by CI) — no doc-affecting changemake test(will be checked by CI)make lint(will be checked by CI)On tests: the existing unit tests for these resources cover the helpers (
mapFields,toCreatePayload, ...) and pass both before and after this change — they never reach theUpdatemethod, so they cannot catch this class of defect. Verifying it genuinely requires an acceptance test that performs an update against the API, which I cannot run here. Happy to add one if you would like it in this PR, though it may fit better as a follow-up covering the DSA services together.