You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/internal/hcp/registry/null_registry.go

47 lines
1003 B

// Copyright IBM Corp. 2013, 2025
// SPDX-License-Identifier: BUSL-1.1
package registry
import (
"context"
"github.com/hashicorp/hcl/v2"
sdkpacker "github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/hashicorp/packer/packer"
)
// nullRegistry is a special handler that does nothing
type nullRegistry struct{}
func (r nullRegistry) PopulateVersion(context.Context) error {
return nil
}
func (r nullRegistry) StartBuild(context.Context, *packer.CoreBuild) error {
return nil
}
func (r nullRegistry) CompleteBuild(
ctx context.Context,
build *packer.CoreBuild,
artifacts []sdkpacker.Artifact,
buildErr error,
) ([]sdkpacker.Artifact, error) {
return artifacts, nil
}
func (r nullRegistry) VersionStatusSummary() {}
func (r nullRegistry) Metadata() Metadata {
return NilMetadata{}
}
func (r nullRegistry) FetchEnforcedBlocks(ctx context.Context) error {
return nil
}
func (r nullRegistry) InjectEnforcedProvisioners(builds []*packer.CoreBuild) hcl.Diagnostics {
return nil
}