configadapter

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const SchemaVersion = "v1.0.0"

Variables

This section is empty.

Functions

func IsPorterBundle

func IsPorterBundle(bun bundle.Bundle) bool

Types

type ManifestConverter

type ManifestConverter struct {
	*context.Context
	Manifest     *manifest.Manifest
	ImageDigests map[string]string
	Mixins       []mixin.Metadata
}

ManifestConverter converts from a porter manifest to a CNAB bundle definition.

func NewManifestConverter

func NewManifestConverter(
	cxt *context.Context,
	manifest *manifest.Manifest,
	imageDigests map[string]string,
	mixins []mixin.Metadata,
) *ManifestConverter

func (*ManifestConverter) DigestManifest

func (c *ManifestConverter) DigestManifest() (string, error)

func (*ManifestConverter) GenerateStamp

func (c *ManifestConverter) GenerateStamp() (Stamp, error)

func (*ManifestConverter) ToBundle

func (c *ManifestConverter) ToBundle() (bundle.Bundle, error)

type MixinRecord

type MixinRecord struct{}

MixinRecord contains information about a mixin used in a bundle For now it is a placeholder for data that we would like to include in the future.

type Stamp

type Stamp struct {
	// ManifestDigest takes into account all unique data that goes into a
	// porter build to help determine if the last build is stale.
	// * manifest
	// * mixins
	// * (TODO) files in current directory
	ManifestDigest string `json:"manifestDigest"`

	// Mixins used in the bundle.
	Mixins map[string]MixinRecord `json:"mixins"`

	// Manifest is the base64 encoded porter.yaml.
	EncodedManifest string `json:"manifest"`

	// Version and commit define the version of the Porter used when a bundle was built.
	Version string `json:"version"`
	Commit  string `json:"commit"`
}

Stamp contains Porter specific metadata about a bundle that we can place in the custom section of a bundle.json

func LoadStamp

func LoadStamp(bun bundle.Bundle) (Stamp, error)

func (Stamp) DecodeManifest

func (s Stamp) DecodeManifest() ([]byte, error)

DecodeManifest base64 decodes the manifest stored in the stamp

func (Stamp) WriteManifest

func (s Stamp) WriteManifest(cxt *context.Context, path string) error

Jump to

Keyboard shortcuts

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