s2i

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = builders.S2I

DefaultName when no WithName option is provided to NewBuilder

Variables

View Source
var DefaultBuilderImages = map[string]string{
	"node":       DefaultNodeBuilder,
	"nodejs":     DefaultNodeBuilder,
	"typescript": DefaultNodeBuilder,
	"quarkus":    DefaultQuarkusBuilder,
	"python":     DefaultPythonBuilder,
}

DefaultBuilderImages for s2i builders indexed by Runtime Language

View Source
var DefaultNodeBuilder = "registry.access.redhat.com/ubi8/nodejs-20-minimal"
View Source
var DefaultPythonBuilder = "registry.access.redhat.com/ubi8/python-39"
View Source
var DefaultQuarkusBuilder = "registry.access.redhat.com/ubi8/openjdk-21"

Functions

func BuilderImage

func BuilderImage(f fn.Function, builderName string) (string, error)

Builder Image chooses the correct builder image or defaults.

Types

type Builder

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

Builder of functions using the s2i subsystem.

func NewBuilder

func NewBuilder(options ...Option) *Builder

NewBuilder creates a new instance of a Builder with static defaults.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platform) (err error)

Build the function using the S2I builder.

Platforms: The S2I builder supports at most a single platform to target, and the platform specified must be available in the provided builder image. If the provided builder image is not a multi-architecture image index container, specifying a target platform is redundant, so if provided it must match that of the single-architecture container or the request is invalid.

type DockerClient

type DockerClient interface {
	ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
}

DockerClient is subset of dockerClient.CommonAPIClient required by this package

type Option

type Option func(*Builder)

func WithDockerClient

func WithDockerClient(cli DockerClient) Option

func WithImpl

func WithImpl(s build.Builder) Option

WithImpl sets an optional S2I Builder implementation override to use in place of what will be generated by the S2I build "strategy" system based on the config. Used for mocking the implementation during tests.

func WithName

func WithName(n string) Option

func WithVerbose

func WithVerbose(v bool) Option

WithVerbose toggles verbose logging.

Jump to

Keyboard shortcuts

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