hooks

package
v1.39.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewDeployRunner = newDeployRunner
)

for testing

Functions

func SetupStaticEnvOptions

func SetupStaticEnvOptions(cfg Config)

Types

type BuildEnvOpts

type BuildEnvOpts struct {
	Image        string
	PushImage    bool
	ImageRepo    string
	ImageTag     string
	BuildContext string
}

BuildEnvOpts contains the environment variables to be set in a build type lifecycle hook executor.

func NewBuildEnvOpts added in v1.30.0

func NewBuildEnvOpts(a *latest.Artifact, image string, pushImage bool) (BuildEnvOpts, error)

NewBuildEnvOpts returns `BuildEnvOpts` required to create a `Runner` for build lifecycle hooks

type Config

type Config interface {
	DefaultRepo() *string
	MultiLevelRepo() *bool
	GetWorkingDir() string
	RPCPort() *int
	RPCHTTPPort() *int
}

type DeployEnvOpts

type DeployEnvOpts struct {
	RunID       string
	KubeContext string
	Namespaces  string
}

DeployEnvOpts contains the environment variables to be set in a deploy type lifecycle hook executor.

func NewDeployEnvOpts added in v1.30.0

func NewDeployEnvOpts(runID string, kubeContext string, namespaces []string) DeployEnvOpts

type MockRunner added in v1.31.0

type MockRunner struct {
	PreHooks  func(ctx context.Context, out io.Writer) error
	PostHooks func(ctx context.Context, out io.Writer) error
}

MockRunner implements the Runner interface, to be used in unit tests

func (MockRunner) RunPostHooks added in v1.31.0

func (m MockRunner) RunPostHooks(ctx context.Context, out io.Writer) error

func (MockRunner) RunPreHooks added in v1.31.0

func (m MockRunner) RunPreHooks(ctx context.Context, out io.Writer) error

type Runner added in v1.30.0

type Runner interface {
	// RunPreHooks executes all pre-step hooks defined by the `Runner`
	RunPreHooks(ctx context.Context, out io.Writer) error
	// RunPostHooks executes all post-step hooks defined by the `Runner`
	RunPostHooks(ctx context.Context, out io.Writer) error
}

Runner represents a lifecycle hooks runner

func BuildRunner added in v1.30.0

func BuildRunner(d latest.BuildHooks, opts BuildEnvOpts) Runner

BuildRunner creates a new runner for pre-build and post-build lifecycle hooks

func NewSyncRunner added in v1.30.0

func NewSyncRunner(cli *kubectl.CLI, imageName, imageRef string, namespaces []string, formatter logger.Formatter, d latest.SyncHooks, opts SyncEnvOpts) Runner

type StaticEnvOpts

type StaticEnvOpts struct {
	DefaultRepo    *string
	MultiLevelRepo *bool
	RPCPort        *int
	HTTPPort       *int
	WorkDir        string
}

StaticEnvOpts contains the environment variables to be set in a lifecycle hook executor that don't change during the lifetime of the process.

type SyncEnvOpts

type SyncEnvOpts struct {
	Image                string
	BuildContext         string
	FilesAddedOrModified *string
	FilesDeleted         *string
	KubeContext          string
	Namespaces           string
}

SyncEnvOpts contains the environment variables to be set in a sync type lifecycle hook executor.

func NewSyncEnvOpts added in v1.30.0

func NewSyncEnvOpts(a *latest.Artifact, image string, addOrModifyFiles []string, deleteFiles []string, namespaces []string, kubeContext string) (SyncEnvOpts, error)

Jump to

Keyboard shortcuts

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