Add OpenTofu provider OCI artifact integration test#589
Add OpenTofu provider OCI artifact integration test#589
Conversation
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
|
This part is incorrect Please use the artifact type for both Manifest and Index. Not the config media type (we can leave it empty) |
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
Fixed in 9bf5969. Both |
Description
Adds
OpenTofuITCaseto demonstrate assembling an OpenTofu provider artifact per the OCI provider mirror spec. The test covers the full assembly flow: a platform-specific manifest pushed to the registry, then referenced in an OCI image index.New files:
OpenTofuITCase.java— integration test withshouldAssembleOpenTofuProviderArtifact, following the same pattern asHelmITCase/FluxCDITCaseterraform-provider-aws_5.0.0_linux_amd64.zip— minimal test fixture simulating a provider binaryKey changes:
Manifestand theIndexuseartifactType = "application/vnd.opentofu.provider"so that OpenTofu can recognize them as representing a provider releaseConfigis left asConfig.empty()(no media type override)Index.withArtifactType(String)fluent method to support setting artifact type on an indexIndexTest#shouldAddArtifactTypecovering the new methodKey flow:
Testing done
OpenTofuITCase#shouldAssembleOpenTofuProviderArtifactruns against a local Zot registry via Testcontainers, verifying the manifest and index are pushed and the index resolves thelinux/amd64platform entry.IndexTest#shouldAddArtifactTypeunit-tests the newIndex.withArtifactTypemethod.Submitter checklist
mvn license:update-file-header,mvn spotless:apply,pre-commit run -a,mvn clean installbefore opening the PR✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.