platform

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 12

Documentation

Index

Constants

View Source
const (
	EnvPlatformAPI     = "CNB_PLATFORM_API"
	DefaultPlatformAPI = "0.3"
)
  • Platform Inputs to the Lifecycle and their Default Values

Platform Inputs to the Lifecycle and their Default Values

The CNB Platform Interface Specification, also known as the Platform API, defines the contract between a platform and the lifecycle. Multiple Platform API versions are supported by the lifecycle; for the list of supported versions, see [apiVersion.Platform]. This gives platform operators the flexibility to upgrade to newer lifecycle versions without breaking existing platform implementations, as long as the Platform API version in use is still supported by the CNB project. To view the Platform Interface Specification, see https://github.com/buildpacks/spec/blob/main/platform.md for the latest supported version, or https://github.com/buildpacks/spec/blob/platform/<version>/platform.md for a specific version. The Platform API version can be configured on a per-build basis through the environment; if no version is specified, the default version is used.

View Source
const (
	EnvLogLevel     = "CNB_LOG_LEVEL"
	DefaultLogLevel = "info"

	EnvNoColor = "CNB_NO_COLOR"

	// EnvDeprecationMode is the desired behavior when deprecated APIs (either Platform or Buildpack) are requested.
	EnvDeprecationMode = "CNB_DEPRECATION_MODE" // defaults to ModeQuiet

	// EnvExperimentalMode is the desired behavior when experimental features (such as builds with image extensions) are requested.
	EnvExperimentalMode     = "CNB_EXPERIMENTAL_MODE"
	DefaultExperimentalMode = ModeError

	ModeQuiet = "quiet"
	ModeWarn  = "warn"
	ModeError = "error"
)
View Source
const (
	EnvStackID = "CNB_STACK_ID"
	EnvUID     = "CNB_USER_ID"
	EnvGID     = "CNB_GROUP_ID"
)

A build-time base image contains the OS-level dependencies needed for the build - i.e., dependencies needed for buildpack execution. The following environment variables must be set in the image config for build-time base images. `CNB_USER_ID` and `CNB_GROUP_ID` must match the UID and GID of the user specified in the image config `USER` field.

View Source
const (
	EnvBuildConfigDir = "CNB_BUILD_CONFIG_DIR"
	EnvBuildpacksDir  = "CNB_BUILDPACKS_DIR"
	EnvExtensionsDir  = "CNB_EXTENSIONS_DIR"

	// EnvOrderPath is the location of the order file, which is used for detection. It contains a list of one or more buildpack groups
	// to be tested against application source code, so that the appropriate group for a given build can be determined.
	EnvOrderPath     = "CNB_ORDER_PATH"
	DefaultOrderFile = "order.toml"

	// EnvStackPath is the location of the stack file, which contains information about the runtime base image.
	EnvStackPath = "CNB_STACK_PATH"
)

A "builder" image contains a build-time base image, buildpacks, a lifecycle, and configuration. The following are directories and files that are present in a builder image, and are inputs to the lifecycle.

View Source
const (
	EnvAppDir      = "CNB_APP_DIR"
	EnvLayersDir   = "CNB_LAYERS_DIR"
	EnvPlatformDir = "CNB_PLATFORM_DIR"
)

The following are directory locations that are inputs to the `detect` and `build` phases. They are passed through to buildpacks and/or extensions by the lifecycle, and will each typically be a separate volume mount.

View Source
const (
	// EnvAnalyzedPath is the location of the analyzed file, an output of the `analyze` phase.
	// It contains digest references to OCI images and metadata that are needed for the build.
	// It is an input to (and may be modified by) later lifecycle phases.
	EnvAnalyzedPath     = "CNB_ANALYZED_PATH"
	DefaultAnalyzedFile = "analyzed.toml"

	// EnvGroupPath is the location of the group file, an output of the `detect` phase.
	// It contains the group of buildpacks that detected.
	EnvGroupPath     = "CNB_GROUP_PATH"
	DefaultGroupFile = "group.toml"

	// EnvPlanPath is the location of the plan file, an output of the `detect` phase.
	// It contains information about dependencies that are needed for the build.
	EnvPlanPath     = "CNB_PLAN_PATH"
	DefaultPlanFile = "plan.toml"

	// EnvGeneratedDir is the location of the directory where the lifecycle should copy any Dockerfiles
	// output by image extensions during the `generate` phase.
	EnvGeneratedDir     = "CNB_GENERATED_DIR"
	DefaultGeneratedDir = "generated"

	// EnvReportPath is the location of the report file, an output of the `export` phase.
	// It contains information about the output application image.
	EnvReportPath     = "CNB_REPORT_PATH"
	DefaultReportFile = "report.toml"
)

The following instruct the lifecycle where to write files and data during the build.

View Source
const (
	// EnvCacheDir is the location of the cache directory. Only one of cache directory or cache image may be used.
	// The cache is used to store buildpack-generated layers that are needed at build-time for future builds.
	EnvCacheDir = "CNB_CACHE_DIR"

	// EnvCacheImage is a reference to the cache image in an OCI registry. Only one of cache directory or cache image may be used.
	// The cache is used to store buildpack-generated layers that are needed at build-time for future builds.
	// Cache images in a daemon are disallowed (for performance reasons).
	EnvCacheImage = "CNB_CACHE_IMAGE"

	// EnvLaunchCacheDir is the location of the launch cache directory.
	// The launch cache is used when exporting to a daemon to store buildpack-generated layers, in order to speed up data retrieval for future builds.
	EnvLaunchCacheDir = "CNB_LAUNCH_CACHE_DIR"

	// EnvSkipLayers when true will instruct the lifecycle to ignore layers from a previously built image.
	EnvSkipLayers = "CNB_SKIP_LAYERS"

	// EnvSkipRestore is used when running the creator, and is equivalent to passing EnvSkipLayers to both the analyzer and
	// the restorer in the 5-phase invocation.
	EnvSkipRestore = "CNB_SKIP_RESTORE"

	// EnvKanikoCacheTTL is the amount of time to persist layers cached by kaniko during the `extend` phase.
	EnvKanikoCacheTTL = "CNB_KANIKO_CACHE_TTL"
)

The following are configuration options with respect to caching.

View Source
const (
	// EnvPreviousImage is a reference to a previously built image; if not provided, it defaults to the output image reference.
	// It allows the lifecycle to re-use image layers that are unchanged from the previous build, avoiding the re-uploading
	// of data to the registry or daemon.
	EnvPreviousImage = "CNB_PREVIOUS_IMAGE"

	// EnvRunImage is a reference to the runtime base image. It is used to construct the output application image.
	EnvRunImage = "CNB_RUN_IMAGE"

	// EnvBuildImage is a reference to the build-time base image. It is needed when image extensions are used to extend the build-time base image.
	EnvBuildImage = "CNB_BUILD_IMAGE"
)

The following are images used by the lifecycle during the build.

View Source
const (
	// EnvProcessType is the default process for the application image, the entrypoint in the output image config.
	EnvProcessType = "CNB_PROCESS_TYPE"

	// EnvProjectMetadataPath is the location of the project metadata file. It contains information about the source repository
	// that is added as metadata to the application image.
	EnvProjectMetadataPath     = "CNB_PROJECT_METADATA_PATH"
	DefaultProjectMetadataFile = "project-metadata.toml"
)

The following are configuration options for the output application image.

View Source
const (
	BuildMetadataLabel   = "io.buildpacks.build.metadata"
	LayerMetadataLabel   = "io.buildpacks.lifecycle.metadata"
	ProjectMetadataLabel = "io.buildpacks.project.metadata"
	StackIDLabel         = "io.buildpacks.stack.id"
	MixinsLabel          = "io.buildpacks.stack.mixins"
)
View Source
const (
	CodeForFailed = 1
)
View Source
const EnvUseDaemon = "CNB_USE_DAEMON"

EnvUseDaemon configures the lifecycle to export the application image to a daemon satisfying the Docker socket interface (e.g., docker, podman). If not provided, the default behavior is to export to an OCI registry. When exporting to a daemon, the socket must be available in the build environment and the lifecycle must be run as root. When exporting to an OCI registry, registry credentials must be provided either on-disk (e.g., `~/.docker/config.json`), via a credential helper, or via the `CNB_REGISTRY_AUTH` environment variable. See [auth.DefaultKeychain] for further information.

View Source
const (
	FeatureDockerfiles = "Dockerfiles"
)

Variables

View Source
var (
	DefaultBuildConfigDir = filepath.Join(path.RootDir, "cnb", "build-config")
	DefaultBuildpacksDir  = filepath.Join(path.RootDir, "cnb", "buildpacks")
	DefaultExtensionsDir  = filepath.Join(path.RootDir, "cnb", "extensions")

	// DefaultOrderPath is the default order path.
	DefaultOrderPath = filepath.Join(path.RootDir, "cnb", "order.toml")

	// DefaultStackPath is the default stack path.
	DefaultStackPath = filepath.Join(path.RootDir, "cnb", "stack.toml")
)
View Source
var (
	DefaultAppDir      = filepath.Join(path.RootDir, "workspace")
	DefaultLayersDir   = filepath.Join(path.RootDir, "layers")
	DefaultPlatformDir = filepath.Join(path.RootDir, "platform")
)

The following are the default locations of input directories if not specified.

View Source
var (
	// DefaultLauncherPath is the default location of the launcher executable during the build.
	// The launcher is exported in the output application image and is used to start application processes at runtime.
	DefaultLauncherPath        = filepath.Join(path.RootDir, "cnb", "lifecycle", "launcher"+path.ExecExt)
	DefaultBuildpacksioSBOMDir = filepath.Join(path.RootDir, "cnb", "lifecycle")
)
View Source
var (
	ErrOutputImageRequired           = "image argument is required"
	ErrRunImageRequiredWhenNoStackMD = "-run-image is required when there is no stack metadata available"
	ErrSupplyOnlyOneRunImage         = "supply only one of -run-image or (deprecated) -image"
	ErrRunImageUnsupported           = "-run-image is unsupported"
	ErrImageUnsupported              = "-image is unsupported"
	MsgIgnoringLaunchCache           = "Ignoring -launch-cache, only intended for use with -daemon"
)
View Source
var DefaultKanikoCacheTTL = 14 * (24 * time.Hour)

DefaultKanikoCacheTTL is the default kaniko cache TTL (2 weeks).

View Source
var ExperimentalMode = envOrDefault(EnvExperimentalMode, DefaultExperimentalMode)

Functions

func CheckCache added in v0.16.0

func CheckCache(i *LifecycleInputs, logger log.Logger) error

func CheckLaunchCache added in v0.16.0

func CheckLaunchCache(i *LifecycleInputs, logger log.Logger) error

func DecodeBuildMetadataTOML added in v0.15.0

func DecodeBuildMetadataTOML(path string, platformAPI *api.Version, buildmd *BuildMetadata) error

DecodeBuildMetadataTOML reads a metadata.toml file

func FillAnalyzeImages added in v0.16.0

func FillAnalyzeImages(i *LifecycleInputs, logger log.Logger) error

func FillCreateImages added in v0.16.0

func FillCreateImages(i *LifecycleInputs, logger log.Logger) error

func FillExportRunImage added in v0.16.0

func FillExportRunImage(i *LifecycleInputs, logger log.Logger) error

func GuardExperimental added in v0.15.0

func GuardExperimental(requested string, logger log.Logger) error

func ResolveAbsoluteDirPaths added in v0.16.0

func ResolveAbsoluteDirPaths(i *LifecycleInputs, _ log.Logger) error

func ResolveInputs added in v0.16.0

func ResolveInputs(phase LifecyclePhase, i *LifecycleInputs, logger log.Logger) error

func UpdatePlaceholderPaths added in v0.16.0

func UpdatePlaceholderPaths(i *LifecycleInputs, _ log.Logger) error

func ValidateImageRefs added in v0.16.0

func ValidateImageRefs(i *LifecycleInputs, _ log.Logger) error

ValidateImageRefs ensures all provided image references are valid.

func ValidateOutputImageProvided added in v0.16.0

func ValidateOutputImageProvided(i *LifecycleInputs, logger log.Logger) error

func ValidateRebaseRunImage added in v0.16.0

func ValidateRebaseRunImage(i *LifecycleInputs, _ log.Logger) error

func ValidateSameRegistry added in v0.16.0

func ValidateSameRegistry(tags ...string) error

func ValidateTargetsAreSameRegistry added in v0.16.0

func ValidateTargetsAreSameRegistry(i *LifecycleInputs, _ log.Logger) error

ValidateTargetsAreSameRegistry ensures all output images are on the same registry.

Types

type AnalyzedMetadata

type AnalyzedMetadata struct {
	PreviousImage *ImageIdentifier `toml:"image"`
	Metadata      LayersMetadata   `toml:"metadata"`
	RunImage      *ImageIdentifier `toml:"run-image,omitempty"`
	BuildImage    *ImageIdentifier `toml:"build-image,omitempty"`
}

func ReadAnalyzed added in v0.16.0

func ReadAnalyzed(analyzedPath string, logger log.Logger) (AnalyzedMetadata, error)

type BuildMetadata

type BuildMetadata struct {
	BOM                         []buildpack.BOMEntry     `toml:"bom,omitempty" json:"bom"`
	Buildpacks                  []buildpack.GroupElement `toml:"buildpacks" json:"buildpacks"`
	Extensions                  []buildpack.GroupElement `toml:"extensions,omitempty" json:"extensions,omitempty"`
	Labels                      []buildpack.Label        `toml:"labels" json:"-"`
	Launcher                    LauncherMetadata         `toml:"-" json:"launcher"`
	Processes                   []launch.Process         `toml:"processes" json:"processes"`
	Slices                      []layers.Slice           `toml:"slices" json:"-"`
	BuildpackDefaultProcessType string                   `toml:"buildpack-default-process-type,omitempty" json:"buildpack-default-process-type,omitempty"`
	PlatformAPI                 *api.Version             `toml:"-" json:"-"`
}

func (*BuildMetadata) MarshalJSON added in v0.14.0

func (md *BuildMetadata) MarshalJSON() ([]byte, error)

func (BuildMetadata) ToLaunchMD

func (md BuildMetadata) ToLaunchMD() launch.Metadata

type BuildPlan

type BuildPlan struct {
	Entries []BuildPlanEntry `toml:"entries"`
}

func (BuildPlan) Filter

func (p BuildPlan) Filter(metRequires []string) BuildPlan

FIXME: ensure at least one claimed entry of each name is provided by the BP

func (BuildPlan) Find

func (p BuildPlan) Find(kind, id string) buildpack.Plan

type BuildPlanEntry

type BuildPlanEntry struct {
	Providers []buildpack.GroupElement `toml:"providers"`
	Requires  []buildpack.Require      `toml:"requires"`
}

func (BuildPlanEntry) NoOpt

func (be BuildPlanEntry) NoOpt() BuildPlanEntry

type BuildReport

type BuildReport struct {
	BOM []buildpack.BOMEntry `toml:"bom"`
}

type CacheMetadata

type CacheMetadata struct {
	BOM        LayerMetadata              `json:"sbom"`
	Buildpacks []buildpack.LayersMetadata `json:"buildpacks"`
}

func (*CacheMetadata) MetadataForBuildpack

func (cm *CacheMetadata) MetadataForBuildpack(id string) buildpack.LayersMetadata

type DefaultExiter added in v0.13.2

type DefaultExiter struct{}

func (*DefaultExiter) CodeFor added in v0.13.2

func (e *DefaultExiter) CodeFor(errType LifecycleExitError) int

type DirStore added in v0.15.0

type DirStore struct {
	// contains filtered or unexported fields
}

func NewDirStore added in v0.15.0

func NewDirStore(buildpacksDir string, extensionsDir string) *DirStore

func (*DirStore) Lookup added in v0.15.0

func (s *DirStore) Lookup(kind, id, version string) (buildpack.Descriptor, error)

func (*DirStore) LookupBp added in v0.15.0

func (s *DirStore) LookupBp(id, version string) (*buildpack.BpDescriptor, error)

func (*DirStore) LookupExt added in v0.15.0

func (s *DirStore) LookupExt(id, version string) (*buildpack.ExtDescriptor, error)

type Exiter added in v0.13.2

type Exiter interface {
	CodeFor(errType LifecycleExitError) int
}

func NewExiter added in v0.14.1

func NewExiter(platformAPI string) Exiter

type ExportReport

type ExportReport struct {
	Build BuildReport `toml:"build,omitempty"`
	Image ImageReport `toml:"image"`
}

type GitMetadata

type GitMetadata struct {
	Repository string `json:"repository"`
	Commit     string `json:"commit"`
}

type ImageIdentifier

type ImageIdentifier struct {
	Reference string `toml:"reference"`
}

FIXME: fix key names to be accurate in the daemon case

type ImageReport

type ImageReport struct {
	Tags         []string `toml:"tags"`
	ImageID      string   `toml:"image-id,omitempty"`
	Digest       string   `toml:"digest,omitempty"`
	ManifestSize int64    `toml:"manifest-size,omitzero"`
}

type LauncherMetadata

type LauncherMetadata struct {
	Version string         `json:"version"`
	Source  SourceMetadata `json:"source"`
}

type LayerMetadata

type LayerMetadata struct {
	SHA string `json:"sha" toml:"sha"`
}

type LayersMetadata

type LayersMetadata struct {
	App          []LayerMetadata            `json:"app" toml:"app"`
	BOM          *LayerMetadata             `json:"sbom,omitempty" toml:"sbom,omitempty"`
	Buildpacks   []buildpack.LayersMetadata `json:"buildpacks" toml:"buildpacks"`
	Config       LayerMetadata              `json:"config" toml:"config"`
	Launcher     LayerMetadata              `json:"launcher" toml:"launcher"`
	ProcessTypes LayerMetadata              `json:"process-types" toml:"process-types"`
	RunImage     RunImageMetadata           `json:"runImage" toml:"run-image"`
	Stack        StackMetadata              `json:"stack" toml:"stack"`
}

NOTE: This struct MUST be kept in sync with `LayersMetadataCompat`

func (*LayersMetadata) MetadataForBuildpack

func (m *LayersMetadata) MetadataForBuildpack(id string) buildpack.LayersMetadata

type LayersMetadataCompat

type LayersMetadataCompat struct {
	App          interface{}                `json:"app" toml:"app"`
	BOM          *LayerMetadata             `json:"sbom,omitempty" toml:"sbom,omitempty"`
	Buildpacks   []buildpack.LayersMetadata `json:"buildpacks" toml:"buildpacks"`
	Config       LayerMetadata              `json:"config" toml:"config"`
	Launcher     LayerMetadata              `json:"launcher" toml:"launcher"`
	ProcessTypes LayerMetadata              `json:"process-types" toml:"process-types"`
	RunImage     RunImageMetadata           `json:"runImage" toml:"run-image"`
	Stack        StackMetadata              `json:"stack" toml:"stack"`
}

NOTE: This struct MUST be kept in sync with `LayersMetadata`. It exists for situations where the `App` field type cannot be guaranteed, yet the original struct data must be maintained.

type LegacyExiter added in v0.13.2

type LegacyExiter struct{}

func (*LegacyExiter) CodeFor added in v0.13.2

func (e *LegacyExiter) CodeFor(errType LifecycleExitError) int

type LifecycleExitError added in v0.13.2

type LifecycleExitError int
const (
	FailedDetect             LifecycleExitError = iota // generic detect error
	FailedDetectWithErrors                             // no buildpacks detected
	DetectError                                        // no buildpacks detected and at least one errored
	AnalyzeError                                       // generic analyze error
	RestoreError                                       // generic restore error
	FailedBuildWithErrors                              // buildpack error during /bin/build
	BuildError                                         // generic build error
	ExportError                                        // generic export error
	RebaseError                                        // generic rebase error
	LaunchError                                        // generic launch error
	FailedGenerateWithErrors                           // extension error during /bin/generate
	GenerateError                                      // generic generate error
	ExtendError                                        // generic extend error
)

type LifecycleInputs added in v0.16.0

type LifecycleInputs struct {
	PlatformAPI           *api.Version
	AnalyzedPath          string
	AppDir                string
	BuildConfigDir        string
	BuildImageRef         string
	BuildpacksDir         string
	CacheDir              string
	CacheImageRef         string
	DefaultProcessType    string
	DeprecatedRunImageRef string
	ExtensionsDir         string
	GeneratedDir          string
	GroupPath             string
	KanikoDir             string
	LaunchCacheDir        string
	LauncherPath          string
	LauncherSBOMDir       string
	LayersDir             string
	LogLevel              string
	OrderPath             string
	OutputImageRef        string
	PlanPath              string
	PlatformDir           string
	PreviousImageRef      string
	ProjectMetadataPath   string
	ReportPath            string
	RunImageRef           string
	StackPath             string
	UID                   int
	GID                   int
	SkipLayers            bool
	UseDaemon             bool
	AdditionalTags        str.Slice // str.Slice satisfies the `Value` interface required by the `flag` package
	KanikoCacheTTL        time.Duration
}

LifecycleInputs holds the values of command-line flags and args i.e., platform inputs to the lifecycle. Fields are the cumulative total of inputs across all lifecycle phases and all supported Platform APIs.

func DefaultAnalyzeInputs added in v0.16.0

func DefaultAnalyzeInputs(platformAPI *api.Version) LifecycleInputs

DefaultAnalyzeInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `analyze` phase.

func DefaultBuildInputs added in v0.16.0

func DefaultBuildInputs(platformAPI *api.Version) LifecycleInputs

DefaultBuildInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `build` phase.

func DefaultCreateInputs added in v0.16.0

func DefaultCreateInputs(platformAPI *api.Version) LifecycleInputs

DefaultCreateInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `create` phase.

func DefaultDetectInputs added in v0.16.0

func DefaultDetectInputs(platformAPI *api.Version) LifecycleInputs

DefaultDetectInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `detect` phase.

func DefaultExportInputs added in v0.16.0

func DefaultExportInputs(platformAPI *api.Version) LifecycleInputs

DefaultExportInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `export` phase.

func DefaultExtendInputs added in v0.16.0

func DefaultExtendInputs(platformAPI *api.Version) LifecycleInputs

DefaultExtendInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `extend` phase.

func DefaultRebaseInputs added in v0.16.0

func DefaultRebaseInputs(platformAPI *api.Version) LifecycleInputs

DefaultRebaseInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `rebase` phase.

func DefaultRestoreInputs added in v0.16.0

func DefaultRestoreInputs(platformAPI *api.Version) LifecycleInputs

DefaultRestoreInputs accepts a Platform API version and returns a set of lifecycle inputs with default values filled in for the `restore` phase.

func (*LifecycleInputs) DestinationImages added in v0.16.0

func (i *LifecycleInputs) DestinationImages() []string

func (*LifecycleInputs) Images added in v0.16.0

func (i *LifecycleInputs) Images() []string

func (*LifecycleInputs) RegistryImages added in v0.16.0

func (i *LifecycleInputs) RegistryImages() []string

type LifecycleInputsOperation added in v0.16.0

type LifecycleInputsOperation func(i *LifecycleInputs, logger log.Logger) error

type LifecyclePhase added in v0.16.0

type LifecyclePhase int
const (
	Analyze LifecyclePhase = iota
	Detect
	Restore
	Extend
	Build
	Export
	Create
	Rebase
)

type Platform

type Platform struct {
	Phase LifecyclePhase
	LifecycleInputs
	Exiter
}

Platform holds lifecycle inputs and outputs for a given Platform API version and lifecycle phase.

func NewPlatformFor added in v0.16.0

func NewPlatformFor(phase LifecyclePhase, platformAPI string) *Platform

NewPlatformFor accepts a lifecycle phase and Platform API version, and returns a Platform.

func (*Platform) API

func (p *Platform) API() *api.Version

type ProjectMetadata

type ProjectMetadata struct {
	Source *ProjectSource `toml:"source" json:"source,omitempty"`
}

type ProjectSource

type ProjectSource struct {
	Type     string                 `toml:"type" json:"type,omitempty"`
	Version  map[string]interface{} `toml:"version" json:"version,omitempty"`
	Metadata map[string]interface{} `toml:"metadata" json:"metadata,omitempty"`
}

type RunImageMetadata

type RunImageMetadata struct {
	TopLayer  string `json:"topLayer" toml:"top-layer"`
	Reference string `json:"reference" toml:"reference"`
}

type SourceMetadata

type SourceMetadata struct {
	Git GitMetadata `json:"git"`
}

type StackMetadata

type StackMetadata struct {
	RunImage StackRunImageMetadata `json:"runImage" toml:"run-image"`
}

func ReadStack added in v0.16.0

func ReadStack(stackPath string, logger log.Logger) (StackMetadata, error)

func (*StackMetadata) BestRunImageMirror

func (sm *StackMetadata) BestRunImageMirror(registry string) (string, error)

type StackRunImageMetadata

type StackRunImageMetadata struct {
	Image   string   `toml:"image" json:"image"`
	Mirrors []string `toml:"mirrors" json:"mirrors,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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