Skip to content

fix(scaleway): set an existing secret instead of failing on Scaleway's 400 - #504

Merged
domenkozar merged 1 commit into
cachix:mainfrom
cramt:scaleway-set-existing
Oct 26, 2026
Merged

domenkozar merged 1 commit into
cachix:mainfrom
cramt:scaleway-set-existing

Conversation

@cramt

@cramt cramt commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

secretspec set on a Scaleway secret that already exists always failed. ensure_secret falls back to looking the secret up on 409, but Scaleway answers a taken name with 400 invalid_arguments.

 ensure_secret
   POST /secrets {project_id, name, path}
   200 | 201 => created id
   409       => lookup_secret_id
+  400 with details[name] "cannot have same secret name"
+            => lookup_secret_id
+  other 400 => error, as before

Evidence

  • Before: secretspec set GITHUB_CLIENT_ID --provider scaleway://fr-par?project_id=… on an existing secret:
    Provider operation failed: Scaleway returned HTTP 400 while creating secret: {"details":[{"argument_name":"name","help_message":"cannot have same secret name in same path","reason":"format"}],"message":"invalid argument(s)","type":"invalid_arguments"}
    
    After: duplicate_name_is_recognized checks that exact body is treated as "exists", and that a 400 about another argument (or a body that isn't JSON) still fails. cargo test --no-default-features --features cli,scaleway --lib provider::scaleway: 19 passed. Clippy is clean.

…s 400

Creating a secret whose name is taken returns 400 invalid_arguments
("cannot have same secret name in same path"), not the 409 ensure_secret
expected, so set on any existing secret failed. Recognize that 400 and fall
back to the lookup, as 409 already did.
@domenkozar
domenkozar merged commit 057c390 into cachix:main Oct 26, 2026
23 checks passed
@cramt
cramt deleted the scaleway-set-existing branch October 26, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants