converter

package
v0.0.0-...-5b8e820 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CNABVersion is the currently supported CNAB runtime version
	CNABVersion = "v1.0.0-WD"

	// OCIIndexSchemaVersion is the currently supported OCI index schema's version
	OCIIndexSchemaVersion = 1
)
View Source
const (
	// DockerAppFormatAnnotation is the top level annotation specifying the kind of the App Bundle
	DockerAppFormatAnnotation = "io.docker.app.format"
	// DockerAppFormatCNAB is the DockerAppFormatAnnotation value for CNAB
	DockerAppFormatCNAB dockerAppFormatValue = "cnab"

	// DockerTypeAnnotation is the annotation that designates the type of the application
	DockerTypeAnnotation = "io.docker.type"
	// DockerTypeApp is the value used to fill DockerTypeAnnotation when targeting a docker-app
	DockerTypeApp dockerTypeValue = "app"

	// CNABRuntimeVersionAnnotation is the top level annotation specifying the CNAB runtime version
	CNABRuntimeVersionAnnotation = "io.cnab.runtime_version"
	// CNABKeywordsAnnotation is the top level annotation specifying a list of keywords
	CNABKeywordsAnnotation = "io.cnab.keywords"
)
View Source
const (
	// CNABDescriptorTypeAnnotation is a descriptor-level annotation specifying the type of reference image (currently invocation or component)
	CNABDescriptorTypeAnnotation = "io.cnab.type"
	// CNABDescriptorTypeInvocation is the CNABDescriptorTypeAnnotation value for invocation images
	CNABDescriptorTypeInvocation cnabDescriptorTypeValue = "invocation"
	// CNABDescriptorTypeComponent is the CNABDescriptorTypeAnnotation value for component images
	CNABDescriptorTypeComponent cnabDescriptorTypeValue = "component"
	// CNABDescriptorTypeConfig is the CNABDescriptorTypeAnnotation value for bundle configuration
	CNABDescriptorTypeConfig cnabDescriptorTypeValue = "config"

	// CNABDescriptorComponentNameAnnotation is a decriptor-level annotation specifying the component name
	CNABDescriptorComponentNameAnnotation = "io.cnab.component_name"

	// CNABDescriptorOriginalNameAnnotation is a decriptor-level annotation specifying the original image name
	CNABDescriptorOriginalNameAnnotation = "io.cnab.original_name"
)

Variables

This section is empty.

Functions

func ConvertBundleToOCIIndex

func ConvertBundleToOCIIndex(b *bundle.Bundle, targetRef reference.Named, bundleConfigManifestRef ocischemav1.Descriptor) (*ocischemav1.Index, error)

ConvertBundleToOCIIndex converts a CNAB bundle into an OCI Index representation

func ConvertOCIIndexToBundle

func ConvertOCIIndexToBundle(ix *ocischemav1.Index, config *BundleConfig, originRepo reference.Named) (*bundle.Bundle, error)

ConvertOCIIndexToBundle converts an OCI index to a CNAB bundle representation

func GetBundleConfigManifestDescriptor

func GetBundleConfigManifestDescriptor(ix *ocischemav1.Index) (ocischemav1.Descriptor, error)

GetBundleConfigManifestDescriptor returns the CNAB runtime config manifest descriptor from a OCI index

Types

type BundleConfig

type BundleConfig struct {
	SchemaVersion string                                `json:"schema_version" mapstructure:"schema_version"`
	Actions       map[string]bundle.Action              `json:"actions,omitempty" mapstructure:"actions,omitempty"`
	Parameters    map[string]bundle.ParameterDefinition `json:"parameters" mapstructure:"parameters"`
	Credentials   map[string]bundle.Location            `json:"credentials" mapstructure:"credentials"`
}

BundleConfig describes a cnab bundle runtime config

func CreateBundleConfig

func CreateBundleConfig(b *bundle.Bundle) *BundleConfig

CreateBundleConfig creates a bundle config from a CNAB

func (*BundleConfig) PrepareForPush

func (c *BundleConfig) PrepareForPush() (blob []byte, manifest []byte, blobDescriptor ocischemav1.Descriptor, manifestDescriptor ocischemav1.Descriptor, err error)

PrepareForPush serializes a bundle config, generates its image manifest, and its manifest descriptor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL