resource_remote: add mirrorlist attribute (rpm/deb/apk remotes)
Expose the artifactapi remotes API's new mirrorlist field so users can configure extra upstream mirror base URLs. The API load-balances base_url + mirrorlist with failover. - Add optional mirrorlist list attribute to the remote resource schema and the remote data source (read-only). - Wire it end-to-end: TF model, wire model (json mirrorlist,omitempty), modelToAPI/apiToModel, and preserve null/empty list semantics to avoid plan churn. - Scope to rpm/deb/alpine via ValidateConfig (plan-time error on other remote types); API 400 is the backstop. - Docs + rpm example; unit tests for round-trip, null handling, and the type-scoping validation.
This commit is contained in:
@@ -18,6 +18,13 @@ resource "artifactapi_remote_rpm" "almalinux" {
|
||||
base_url = "https://gsl-syd.mm.fcix.net/almalinux"
|
||||
description = "AlmaLinux RPM package repository"
|
||||
|
||||
# Extra mirrors; requests are load-balanced with failover across
|
||||
# base_url + mirrorlist (rpm/deb/alpine remotes only).
|
||||
mirrorlist = [
|
||||
"https://mirror.aarnet.edu.au/pub/almalinux",
|
||||
"https://mirror.realcompute.io/almalinux",
|
||||
]
|
||||
|
||||
immutable_ttl = 0
|
||||
mutable_ttl = 7200
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user