Repository navigation
fix(scaleway): set an existing secret instead of failing on Scaleway's 400 - #504
Merged
Merged
Conversation
…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.
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.
Summary
secretspec seton a Scaleway secret that already exists always failed.ensure_secretfalls back to looking the secret up on 409, but Scaleway answers a taken name with 400invalid_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 beforeEvidence
secretspec set GITHUB_CLIENT_ID --provider scaleway://fr-par?project_id=…on an existing secret:duplicate_name_is_recognizedchecks 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.