Add artifactapi_local_alpine resource #16

Merged
benvin merged 1 commits from benvin/apk-local into main 2026-08-12 20:41:03 +10:00
Member

Why

ArtifactAPI supports local Alpine/apk repositories as real registries, but the Terraform provider had no resource to manage them. This adds artifactapi_local_alpine, mirroring the existing artifactapi_local_deb / artifactapi_local_rpm locals so Alpine package registries can be declared alongside the rest of the fleet. The provider only passes package/repo type strings through the shared API, so it compiles and tests independently of the parallel server-side Alpine work.

How

  • Add internal/provider/resource_local_alpine.golocalAlpineResource with full CRUD + import passthrough and model<->API mappers setting PackageType: "alpine", RepoType: "local".
  • Register NewLocalAlpineResource in provider Resources().
  • Bump provider_test resource count 20 -> 21 and add artifactapi_local_alpine to the expected type-name list.
  • Add resource_local_alpine_test.go (ModelToAPI/APIToModel/RoundTrip/Metadata/Schema/constructor).
  • Add README local-resources entry and examples/resources/artifactapi_local_alpine/main.tf.

go build, go vet, go mod tidy, make test (-race), and pre-commit all pass.

## Why ArtifactAPI supports local Alpine/apk repositories as real registries, but the Terraform provider had no resource to manage them. This adds `artifactapi_local_alpine`, mirroring the existing `artifactapi_local_deb` / `artifactapi_local_rpm` locals so Alpine package registries can be declared alongside the rest of the fleet. The provider only passes package/repo type strings through the shared API, so it compiles and tests independently of the parallel server-side Alpine work. ## How - Add `internal/provider/resource_local_alpine.go` — `localAlpineResource` with full CRUD + import passthrough and model<->API mappers setting `PackageType: "alpine"`, `RepoType: "local"`. - Register `NewLocalAlpineResource` in provider `Resources()`. - Bump `provider_test` resource count 20 -> 21 and add `artifactapi_local_alpine` to the expected type-name list. - Add `resource_local_alpine_test.go` (ModelToAPI/APIToModel/RoundTrip/Metadata/Schema/constructor). - Add README local-resources entry and `examples/resources/artifactapi_local_alpine/main.tf`. `go build`, `go vet`, `go mod tidy`, `make test` (-race), and pre-commit all pass.
unkin-agent added 1 commit 2026-08-12 00:53:01 +10:00
Add artifactapi_local_alpine resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
cb1110c723
Adds a local Alpine/apk repository resource mirroring the existing
artifactapi_local_deb and artifactapi_local_rpm locals, so Alpine
package registries can be managed directly via Terraform.

- add localAlpineResource (PackageType alpine, RepoType local) with
  CRUD + import passthrough and model<->API mappers
- register NewLocalAlpineResource in provider Resources()
- bump provider_test resource count to 21 and expected type list
- add local unit tests and README/example entries
benvin merged commit 8d2e0ef27d into main 2026-08-12 20:41:03 +10:00
benvin deleted branch benvin/apk-local 2026-08-12 20:41:04 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/terraform-provider-artifactapi#16