Documentation ¶
Overview ¶
Package configadapter converts a Porter manifest (porter.yaml) to a CNAB bundle.json
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToTestBundle ¶ added in v1.0.1
func ConvertToTestBundle(ctx context.Context, cfg *config.Config, manifest *manifest.Manifest) (cnab.ExtendedBundle, error)
ConvertToTestBundle is suitable for taking a test manifest (porter.yaml) and making a bundle.json for it. Does not make an accurate representation of the bundle, but is suitable for testing.
Types ¶
type ManifestConverter ¶
type ManifestConverter struct { Manifest *manifest.Manifest ImageDigests map[string]string InstalledMixins []mixin.Metadata // contains filtered or unexported fields }
ManifestConverter converts from a porter manifest to a CNAB bundle definition.
func NewManifestConverter ¶
func (*ManifestConverter) DigestManifest ¶
func (c *ManifestConverter) DigestManifest() (string, error)
func (*ManifestConverter) GenerateStamp ¶
func (c *ManifestConverter) GenerateStamp(ctx context.Context) (Stamp, error)
func (*ManifestConverter) ToBundle ¶
func (c *ManifestConverter) ToBundle(ctx context.Context) (cnab.ExtendedBundle, error)
type MixinRecord ¶
type MixinRecord struct { // Version of the mixin used in the bundle. Version string `json:"version"` }
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 (Stamp) DecodeManifest ¶
DecodeManifest base64 decodes the manifest stored in the stamp
func (Stamp) WriteManifest ¶
func (s Stamp) WriteManifest(cxt *portercontext.Context, path string) error