config

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImagesLockKbldID      = "kbld.carvel.dev/id"
	ImagesLockKbldOrigins = "kbld.carvel.dev/origins"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

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

func NewConfFromResources

func NewConfFromResources(resources []ctlres.Resource) ([]ctlres.Resource, Conf, error)

func (Conf) ImageDestinations

func (c Conf) ImageDestinations() []ImageDestination

func (Conf) ImageOverrides

func (c Conf) ImageOverrides() []ImageOverride

func (Conf) SearchRules added in v0.41.0

func (c Conf) SearchRules() []SearchRule

func (Conf) SearchRulesWithoutDefaults added in v0.41.0

func (c Conf) SearchRulesWithoutDefaults() []SearchRule

func (Conf) Sources

func (c Conf) Sources() []Source

func (Conf) WithAdditionalConfig added in v0.11.0

func (c Conf) WithAdditionalConfig(config Config) Conf

type Config

type Config struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind,omitempty"`

	MinimumRequiredVersion string `json:"minimumRequiredVersion,omitempty"`

	Sources      []Source           `json:"sources,omitempty"`
	Overrides    []ImageOverride    `json:"overrides,omitempty"`
	Destinations []ImageDestination `json:"destinations,omitempty"`
	Keys         []string           `json:"keys,omitempty"`
	SearchRules  []SearchRule       `json:"searchRules,omitempty"`
}

func NewConfig added in v0.41.0

func NewConfig() Config

func NewConfigFromImagesLock added in v0.41.0

func NewConfigFromImagesLock(res ctlres.Resource) (Config, error)

func NewConfigFromResource

func NewConfigFromResource(res ctlres.Resource) (Config, error)

func (Config) AsBytes added in v0.41.0

func (d Config) AsBytes() ([]byte, error)

func (Config) Validate

func (d Config) Validate() error

func (Config) WriteToFile added in v0.41.0

func (d Config) WriteToFile(path string) error

type ImageDestination

type ImageDestination struct {
	ImageRef
	NewImage string   `json:"newImage"`
	Tags     []string `json:"tags"`
}

func (ImageDestination) Validate

func (d ImageDestination) Validate() error

type ImageOverride

type ImageOverride struct {
	ImageRef
	NewImage          string                     `json:"newImage"`
	Preresolved       bool                       `json:"preresolved,omitempty"`
	TagSelection      *versions.VersionSelection `json:"tagSelection,omitempty"`
	PlatformSelection *PlatformSelection         `json:"platformSelection,omitempty"`
	ImageOrigins      []Origin                   `json:"origins,omitempty"`
}

func UniqueImageOverrides added in v0.41.0

func UniqueImageOverrides(overrides []ImageOverride) []ImageOverride

func (ImageOverride) Equal added in v0.41.0

func (d ImageOverride) Equal(other ImageOverride) bool

Equal reports whether this ImageOverride is equal to another ImageOverride. (`ImageMeta` is descriptive — not identifying — so not part of equality)

func (ImageOverride) Validate

func (d ImageOverride) Validate() error

type ImageRef added in v0.41.0

type ImageRef struct {
	Image     string `json:"image,omitempty"`
	ImageRepo string `json:"imageRepo,omitempty"`
}

func (ImageRef) Validate added in v0.41.0

func (r ImageRef) Validate() error

type Kind added in v0.41.0

type Kind struct {
	APIVersion, Kind string
}

type Origin added in v0.41.0

type Origin struct {
	Git              *OriginGit              `json:"git,omitempty"`
	Local            *OriginLocal            `json:"local,omitempty"`
	Resolved         *OriginResolved         `json:"resolved,omitempty"`
	Tagged           *OriginTagged           `json:"tagged,omitempty"`
	Preresolved      *OriginPreresolved      `json:"preresolved,omitempty"`
	PlatformSelected *OriginPlatformSelected `json:"platformSelected,omitempty"`
}

func NewOriginsFromString added in v0.41.0

func NewOriginsFromString(str string) ([]Origin, error)

type OriginGit added in v0.41.0

type OriginGit struct {
	RemoteURL string   `json:"remoteURL"`
	SHA       string   `json:"sha"`
	Dirty     bool     `json:"dirty"`
	Tags      []string `json:"tags,omitempty"`
}

type OriginLocal added in v0.41.0

type OriginLocal struct {
	Path string `json:"path"`
}

type OriginPlatformSelected added in v0.41.0

type OriginPlatformSelected struct {
	Index        string `json:"index,omitempty"`
	OS           string `json:"os,omitempty"`
	Architecture string `json:"architecture,omitempty"`
	Variant      string `json:"variant,omitempty"`
}

type OriginPreresolved added in v0.41.0

type OriginPreresolved struct {
	URL string `json:"url"`
}

type OriginResolved added in v0.41.0

type OriginResolved struct {
	URL string `json:"url"`
	Tag string `json:"tag,omitempty"`
}

type OriginTagged added in v0.41.0

type OriginTagged struct {
	Tags []string `json:"tags"`
}

type PlatformSelection added in v0.41.0

type PlatformSelection struct {
	Architecture string   `json:"architecture,omitempty"`
	OS           string   `json:"os,omitempty"`
	OSVersion    string   `json:"os.version,omitempty"`  // note dot
	OSFeatures   []string `json:"os.features,omitempty"` // note dot
	Variant      string   `json:"variant,omitempty"`
	Features     []string `json:"features,omitempty"`
}

PlatformSelection https://github.com/opencontainers/image-spec/blob/main/image-index.md#image-index-property-descriptions

type SearchRule added in v0.41.0

type SearchRule struct {
	KeyMatcher     *SearchRuleKeyMatcher     `json:"keyMatcher,omitempty"`
	ValueMatcher   *SearchRuleValueMatcher   `json:"valueMatcher,omitempty"`
	UpdateStrategy *SearchRuleUpdateStrategy `json:"updateStrategy,omitempty"`
}

func (SearchRule) UpdateStrategyWithDefaults added in v0.41.0

func (d SearchRule) UpdateStrategyWithDefaults() SearchRuleUpdateStrategy

func (SearchRule) Validate added in v0.41.0

func (d SearchRule) Validate() error

type SearchRuleKeyMatcher added in v0.41.0

type SearchRuleKeyMatcher struct {
	Name string      `json:"name,omitempty"`
	Path ctlres.Path `json:"path,omitempty"`
}

type SearchRuleUpdateStrategy added in v0.41.0

type SearchRuleUpdateStrategy struct {
	None         *SearchRuleUpdateStrategyNone         `json:"none,omitempty"`
	EntireString *SearchRuleUpdateStrategyEntireString `json:"entireValue,omitempty"`
	JSON         *SearchRuleUpdateStrategyJSON         `json:"json,omitempty"`
	YAML         *SearchRuleUpdateStrategyYAML         `json:"yaml,omitempty"`
}

type SearchRuleUpdateStrategyEntireString added in v0.41.0

type SearchRuleUpdateStrategyEntireString struct{}

type SearchRuleUpdateStrategyJSON added in v0.41.0

type SearchRuleUpdateStrategyJSON struct {
	SearchRules []SearchRule `json:"searchRules,omitempty"`
}

type SearchRuleUpdateStrategyNone added in v0.41.0

type SearchRuleUpdateStrategyNone struct{}

type SearchRuleUpdateStrategyYAML added in v0.41.0

type SearchRuleUpdateStrategyYAML struct {
	SearchRules []SearchRule `json:"searchRules,omitempty"`
}

type SearchRuleValueMatcher added in v0.41.0

type SearchRuleValueMatcher struct {
	Image     string `json:"image,omitempty"`
	ImageRepo string `json:"imageRepo,omitempty"`
}

type Source

type Source struct {
	ImageRef
	Path string

	Docker          *SourceDockerOpts
	Pack            *SourcePackOpts
	KubectlBuildkit *SourceKubectlBuildkitOpts
	Ko              *SourceKoOpts
	Bazel           *SourceBazelOpts
}

func (Source) Validate

func (d Source) Validate() error

type SourceBazelOpts added in v0.41.0

type SourceBazelOpts struct {
	Run SourceBazelRunOpts
}

type SourceBazelRunOpts added in v0.41.0

type SourceBazelRunOpts struct {
	Target     *string   `json:"target"`
	RawOptions *[]string `json:"rawOptions"`
}

type SourceDockerBuildOpts added in v0.10.0

type SourceDockerBuildOpts struct {
	Target     *string
	Pull       *bool
	NoCache    *bool `json:"noCache"`
	File       *string
	Buildkit   *bool
	RawOptions *[]string `json:"rawOptions"`
}

type SourceDockerBuildxOpts added in v0.41.0

type SourceDockerBuildxOpts struct {
	Target     *string
	Pull       *bool
	NoCache    *bool `json:"noCache"`
	File       *string
	RawOptions *[]string `json:"rawOptions"`
}

type SourceDockerOpts added in v0.10.0

type SourceDockerOpts struct {
	Build  SourceDockerBuildOpts
	Buildx *SourceDockerBuildxOpts
}

type SourceKoBuildOpts added in v0.41.0

type SourceKoBuildOpts struct {
	RawOptions *[]string `json:"rawOptions"`
}

type SourceKoOpts added in v0.41.0

type SourceKoOpts struct {
	Build SourceKoBuildOpts
}

type SourceKubectlBuildkitBuildOpts added in v0.41.0

type SourceKubectlBuildkitBuildOpts struct {
	Target     *string
	Platform   *string
	Pull       *bool
	NoCache    *bool `json:"noCache"`
	File       *string
	RawOptions *[]string `json:"rawOptions"`
}

type SourceKubectlBuildkitOpts added in v0.41.0

type SourceKubectlBuildkitOpts struct {
	Build SourceKubectlBuildkitBuildOpts
}

type SourcePackBuildOpts added in v0.12.0

type SourcePackBuildOpts struct {
	Builder    *string
	Buildpacks *[]string
	ClearCache *bool     `json:"clearCache"`
	RawOptions *[]string `json:"rawOptions"`
}

type SourcePackOpts added in v0.12.0

type SourcePackOpts struct {
	Build SourcePackBuildOpts
}

Jump to

Keyboard shortcuts

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