Add artifactapi_local_generic resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Adds a local generic (raw-file) repository resource so arbitrary binaries -- the
bootapi node rootfs tarballs -- can be hosted on artifactapi and managed in
Terraform. The backend already serves generic locals; only the provider surface
was missing.

- resource_local_generic.go: local repo with package_type=generic (mirrors
  local_rpm), registered in the provider.
- Tests + example.

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
This commit is contained in:
2026-07-29 21:48:47 +10:00
parent a232a26bf5
commit 14b7c4bdcd
5 changed files with 297 additions and 2 deletions
+3 -2
View File
@@ -66,8 +66,8 @@ func TestProvider_Resources(t *testing.T) {
p := &ArtifactAPIProvider{version: "1.0.0"}
resources := p.Resources(context.Background())
// 10 remote resource types + 1 virtual + 1 local_terraform + 1 local_pypi + 1 local_rpm + 1 local_docker = 15
expectedCount := 15
// 10 remote resource types + 1 virtual + local_terraform/pypi/rpm/docker/generic = 16
expectedCount := 16
if len(resources) != expectedCount {
t.Fatalf("expected %d resources, got %d", expectedCount, len(resources))
}
@@ -111,6 +111,7 @@ func TestProvider_Resources_ContainsExpectedTypes(t *testing.T) {
"artifactapi_local_pypi",
"artifactapi_local_rpm",
"artifactapi_local_docker",
"artifactapi_local_generic",
}
for _, name := range expected {