resource_remote: add mirror_strategy attribute
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

The provider exposed mirrorlist but not mirror_strategy, so the API's
mirror load-balancing strategy (round_robin/least_conn) was unreachable
via Terraform. Add mirror_strategy the same way mirrorlist was added,
scoped to rpm/deb/alpine remotes.

- schema: optional string mirror_strategy on the remote resource
- ValidateConfig: reject on non-rpm/deb/alpine types and validate the
  round_robin/least_conn enum at plan time
- wire model + modelToAPI/apiToModel (empty->null to avoid perpetual diff)
- datasource (computed) + README + rpm example
- unit tests: modelToAPI/apiToModel round-trip and ValidateConfig matrix
This commit is contained in:
2026-08-13 17:50:52 +10:00
parent bc13e7372d
commit c69c3d9f74
7 changed files with 182 additions and 9 deletions
+1
View File
@@ -6,6 +6,7 @@ type remoteAPI struct {
RepoType string `json:"repo_type,omitempty"`
BaseURL string `json:"base_url"`
Mirrorlist []string `json:"mirrorlist,omitempty"`
MirrorStrategy string `json:"mirror_strategy,omitempty"`
Description string `json:"description,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`