feat: add artifactapi_local_docker resource
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

The artifactapi server now serves local docker repos as real container
registries, but the provider had no resource to declare one — only remote
docker proxies and local terraform/pypi/rpm repos.

- Add the artifactapi_local_docker resource (package_type=docker,
  repo_type=local), mirroring the other local resources: name + description,
  managed via /api/v2/remotes.
- Register it in the provider and update the resource-count/type tests.
- Add unit tests, an example, and a Local Resources section to the README.
This commit is contained in:
2026-07-04 22:37:10 +10:00
parent b149e1bf9d
commit 30b414141a
6 changed files with 322 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 = 14
expectedCount := 14
// 10 remote resource types + 1 virtual + 1 local_terraform + 1 local_pypi + 1 local_rpm + 1 local_docker = 15
expectedCount := 15
if len(resources) != expectedCount {
t.Fatalf("expected %d resources, got %d", expectedCount, len(resources))
}
@@ -110,6 +110,7 @@ func TestProvider_Resources_ContainsExpectedTypes(t *testing.T) {
"artifactapi_local_terraform",
"artifactapi_local_pypi",
"artifactapi_local_rpm",
"artifactapi_local_docker",
}
for _, name := range expected {