composite

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BasicBuilderSchema  = "olm.builder.basic"
	SemverBuilderSchema = "olm.builder.semver"
	RawBuilderSchema    = "olm.builder.raw"
	CustomBuilderSchema = "olm.builder.custom"
)
View Source
const (
	CompositeSchema = "olm.composite"
	CatalogSchema   = "olm.composite.catalogs"
)

Variables

This section is empty.

Functions

func FetchCatalogConfig added in v1.27.0

func FetchCatalogConfig(path string, httpGetter HttpGetter) (io.ReadCloser, error)

FetchCatalogConfig will fetch the catalog configuration file from the given path. The path can be a local file path OR a URL that returns the raw contents of the catalog configuration file. The filepath can be structured relative or as an absolute path

Types

type BasicBuilder

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

func NewBasicBuilder

func NewBasicBuilder(builderCfg BuilderConfig) *BasicBuilder

func (*BasicBuilder) Build

func (*BasicBuilder) Validate

func (bb *BasicBuilder) Validate(ctx context.Context, dir string) error

type BasicConfig

type BasicConfig struct {
	Input  string
	Output string
}

type BuildStrategy

type BuildStrategy struct {
	Name     string
	Template TemplateDefinition
}

type Builder

type Builder interface {
	Build(ctx context.Context, reg image.Registry, dir string, td TemplateDefinition) error
	Validate(ctx context.Context, dir string) error
}

type BuilderConfig

type BuilderConfig struct {
	WorkingDir       string
	OutputType       string
	ContributionPath string
}

type BuilderMap

type BuilderMap map[string]Builder

type Catalog

type Catalog struct {
	Name        string
	Destination CatalogDestination
	Builders    []string
}

type CatalogBuilderMap

type CatalogBuilderMap map[string]BuilderMap

type CatalogConfig

type CatalogConfig struct {
	Schema   string
	Catalogs []Catalog
}

type CatalogDestination

type CatalogDestination struct {
	// BaseImage  string
	WorkingDir string
}

type Component

type Component struct {
	Name        string
	Destination ComponentDestination
	Strategy    BuildStrategy
}

type ComponentDestination

type ComponentDestination struct {
	Path string
}

type CompositeConfig

type CompositeConfig struct {
	Schema     string
	Components []Component
}

type CustomBuilder

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

func NewCustomBuilder

func NewCustomBuilder(builderCfg BuilderConfig) *CustomBuilder

func (*CustomBuilder) Build

func (*CustomBuilder) Validate

func (cb *CustomBuilder) Validate(ctx context.Context, dir string) error

type CustomConfig

type CustomConfig struct {
	Command string
	Args    []string
	Output  string
}

type HttpGetter added in v1.27.0

type HttpGetter interface {
	Get(url string) (*http.Response, error)
}

type RawBuilder

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

func NewRawBuilder

func NewRawBuilder(builderCfg BuilderConfig) *RawBuilder

func (*RawBuilder) Build

func (*RawBuilder) Validate

func (rb *RawBuilder) Validate(ctx context.Context, dir string) error

type RawConfig

type RawConfig struct {
	Input  string
	Output string
}

type SemverBuilder

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

func NewSemverBuilder

func NewSemverBuilder(builderCfg BuilderConfig) *SemverBuilder

func (*SemverBuilder) Build

func (*SemverBuilder) Validate

func (sb *SemverBuilder) Validate(ctx context.Context, dir string) error

type SemverConfig

type SemverConfig struct {
	Input  string
	Output string
}

type Specs added in v1.30.0

type Specs struct {
	CatalogSpec      *CatalogConfig
	ContributionSpec *CompositeConfig
}

type Template

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

func NewTemplate added in v1.27.0

func NewTemplate(opts ...TemplateOption) *Template

func (*Template) Parse added in v1.30.0

func (t *Template) Parse() (*Specs, error)

func (*Template) Render

func (t *Template) Render(ctx context.Context, validate bool) error

type TemplateDefinition

type TemplateDefinition struct {
	Schema string
	Config json.RawMessage
}

type TemplateOption added in v1.27.0

type TemplateOption func(t *Template)

func WithCatalogFile added in v1.27.0

func WithCatalogFile(catalogFile io.Reader) TemplateOption

func WithContributionFile added in v1.27.0

func WithContributionFile(contribFile io.Reader, contribPath string) TemplateOption

func WithOutputType added in v1.27.0

func WithOutputType(outputType string) TemplateOption

func WithRegistry added in v1.27.0

func WithRegistry(reg image.Registry) TemplateOption

func WithValidate added in v1.27.0

func WithValidate(validate bool) TemplateOption

Jump to

Keyboard shortcuts

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