runner

package
v2.11.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorConfigurationChanged = errors.New("configuration changed")

ErrorConfigurationChanged is a special error that's returned when the skaffold configuration was changed.

Functions

func CheckWorkspaces

func CheckWorkspaces(artifacts []*latest.Artifact) error

func GetBuilder

GetBuilder creates a builder from a given RunContext and build pipeline type.

func GetDeployer

func GetDeployer(ctx context.Context, runCtx *runcontext.RunContext, labeller *label.DefaultLabeller, hydrationDir string, usingLegacyHelmDeploy bool) (deploy.Deployer, error)

GetDeployer creates a deployer from a given RunContext and deploy pipeline definitions.

func GetRenderer

func GetRenderer(ctx context.Context, runCtx *runcontext.RunContext, hydrationDir string, labels map[string]string, usingLegacyHelmDeploy bool) (renderer.Renderer, error)

GetRenderer creates a renderer from a given RunContext and pipeline definitions.

func GetVerifier

func GetVerifier(ctx context.Context, runCtx *runcontext.RunContext, labeller *label.DefaultLabeller) (verify.Verifier, error)

GetVerifier creates a verifier from a given RunContext and deploy pipeline definitions.

func WithNotification

func WithNotification(d deploy.Deployer) deploy.Deployer

WithNotification creates a deployer that bips each time a deploy is done.

func WithTimings

WithTimings creates a deployer that logs the duration of each phase.

Types

type ActionsRunner added in v2.4.0

type ActionsRunner interface {
	// Exec triggers the execution of the given action.
	Exec(ctx context.Context, out io.Writer, allbuilds []graph.Artifact, localImgs []graph.Artifact, action string) error

	// ExecAll triggers the execution of all the defined actions.
	ExecAll(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact) error
}

ActionsRunner defines the API used to run custom actions.

func GetActionsRunner added in v2.4.0

func GetActionsRunner(ctx context.Context, runCtx *runcontext.RunContext, l *label.DefaultLabeller, dockerNetwork string, envFile string) (ActionsRunner, error)

type Builder

type Builder struct {
	Builder build.Builder

	Builds []graph.Artifact
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(builder build.Builder, tagger tag.Tagger, platforms platform.Resolver, cache cache.Cache, runCtx *runcontext.RunContext) *Builder

func (*Builder) ApplyDefaultRepo

func (r *Builder) ApplyDefaultRepo(tag string) (string, error)

ApplyDefaultRepo applies the default repo to a given image tag.

func (*Builder) Build

func (r *Builder) Build(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) ([]graph.Artifact, error)

Build builds a list of artifacts.

func (*Builder) GetBuilds

func (r *Builder) GetBuilds() []graph.Artifact

GetBuilds returns the builds value.

func (*Builder) HasBuilt

func (r *Builder) HasBuilt() bool

HasBuilt returns true if this runner has built something.

type ChangeSet

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

func (*ChangeSet) AddRebuild

func (c *ChangeSet) AddRebuild(a *latest.Artifact)

func (*ChangeSet) AddResync

func (c *ChangeSet) AddResync(s *sync.Item)

func (*ChangeSet) AddRetest

func (c *ChangeSet) AddRetest(a *latest.Artifact)

func (*ChangeSet) NeedsRebuild

func (c *ChangeSet) NeedsRebuild() []*latest.Artifact

NeedsRebuild gets the value of needsRebuild, which itself is not expected to be changed outside ChangeSet

func (*ChangeSet) NeedsRedeploy

func (c *ChangeSet) NeedsRedeploy() bool

NeedsRedeploy gets the value of needsRedeploy, which itself is not expected to be changed outside ChangeSet

func (*ChangeSet) NeedsReload

func (c *ChangeSet) NeedsReload() bool

NeedsReload gets the value of needsReload, which itself is not expected to be changed outside ChangeSet

func (*ChangeSet) NeedsResync

func (c *ChangeSet) NeedsResync() []*sync.Item

NeedsResync gets the value of needsResync, which itself is not expected to be changed outside ChangeSet

func (*ChangeSet) NeedsRetest

func (c *ChangeSet) NeedsRetest() map[string]bool

NeedsRetest gets the value of needsRetest, which itself is not expected to be changed outside ChangeSet

func (*ChangeSet) Redeploy

func (c *ChangeSet) Redeploy()

Redeploy marks that deploy is expected to happen.

func (*ChangeSet) Reload

func (c *ChangeSet) Reload()

Reload marks that reload is expected to happen.

func (*ChangeSet) ResetBuild

func (c *ChangeSet) ResetBuild()

func (*ChangeSet) ResetDeploy

func (c *ChangeSet) ResetDeploy()

func (*ChangeSet) ResetSync

func (c *ChangeSet) ResetSync()

func (*ChangeSet) ResetTest

func (c *ChangeSet) ResetTest()

type Intents

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

func NewIntents

func NewIntents(autoBuild, autoSync, autoDeploy bool) *Intents

func (*Intents) GetAutoBuild

func (i *Intents) GetAutoBuild() bool

func (*Intents) GetAutoDeploy

func (i *Intents) GetAutoDeploy() bool

func (*Intents) GetAutoDevloop

func (i *Intents) GetAutoDevloop() bool

func (*Intents) GetAutoSync

func (i *Intents) GetAutoSync() bool

func (*Intents) GetIntents

func (i *Intents) GetIntents() (bool, bool, bool)

GetIntents returns build, sync, and deploy intents (in that order) If intent is devloop intent, all are returned true

func (*Intents) GetIntentsAttrs

func (i *Intents) GetIntentsAttrs() (bool, bool, bool)

GetIntentsAttrs returns the intent attributes for testing only.

func (*Intents) IsAnyAutoEnabled

func (i *Intents) IsAnyAutoEnabled() bool

func (*Intents) Reset

func (i *Intents) Reset()

func (*Intents) ResetBuild

func (i *Intents) ResetBuild()

func (*Intents) ResetDeploy

func (i *Intents) ResetDeploy()

func (*Intents) ResetSync

func (i *Intents) ResetSync()

func (*Intents) SetAutoBuild

func (i *Intents) SetAutoBuild(val bool)

func (*Intents) SetAutoDeploy

func (i *Intents) SetAutoDeploy(val bool)

func (*Intents) SetAutoDevloop

func (i *Intents) SetAutoDevloop(val bool)

func (*Intents) SetAutoSync

func (i *Intents) SetAutoSync(val bool)

func (*Intents) SetBuild

func (i *Intents) SetBuild(val bool)

func (*Intents) SetDeploy

func (i *Intents) SetDeploy(val bool)

func (*Intents) SetDevloop

func (i *Intents) SetDevloop(val bool)

func (*Intents) SetSync

func (i *Intents) SetSync(val bool)

type Listener

type Listener interface {
	WatchForChanges(context.Context, io.Writer, func() error) error
	LogWatchToUser(io.Writer)
}

type Pruner

type Pruner struct {
	build.Builder
}

func (*Pruner) Prune

func (r *Pruner) Prune(ctx context.Context, out io.Writer) error

type Runner

type Runner interface {
	Apply(context.Context, io.Writer) error
	ApplyDefaultRepo(tag string) (string, error)
	Build(context.Context, io.Writer, []*latest.Artifact) ([]graph.Artifact, error)
	Cleanup(context.Context, io.Writer, bool, manifest.ManifestListByConfig, string) error
	Dev(context.Context, io.Writer, []*latest.Artifact) error
	// Deploy and DeployAndLog: Do they need the `graph.Artifact` and could use render output.
	Deploy(context.Context, io.Writer, []graph.Artifact, manifest.ManifestListByConfig) error
	DeployAndLog(context.Context, io.Writer, []graph.Artifact, manifest.ManifestListByConfig) error
	GeneratePipeline(context.Context, io.Writer, []util.VersionedConfig, []string, string) error
	HasBuilt() bool
	DeployManifests() manifest.ManifestListByConfig
	Prune(context.Context, io.Writer) error

	Render(ctx context.Context, out io.Writer, builds []graph.Artifact, offline bool) (manifest.ManifestListByConfig, error)
	Test(context.Context, io.Writer, []graph.Artifact) error
	Verify(context.Context, io.Writer, []graph.Artifact) error
	VerifyAndLog(context.Context, io.Writer, []graph.Artifact) error

	Exec(context.Context, io.Writer, []graph.Artifact, string) error
}

Runner is responsible for running the skaffold build, test and deploy config.

type SkaffoldListener

type SkaffoldListener struct {
	Monitor filemon.Monitor
	Trigger trigger.Trigger
	// contains filtered or unexported fields
}

func NewSkaffoldListener

func NewSkaffoldListener(monitor filemon.Monitor, trigger trigger.Trigger, cache graph.SourceDependenciesCache,
	intentChan <-chan bool) *SkaffoldListener

func (*SkaffoldListener) LogWatchToUser

func (l *SkaffoldListener) LogWatchToUser(out io.Writer)

func (*SkaffoldListener) WatchForChanges

func (l *SkaffoldListener) WatchForChanges(ctx context.Context, out io.Writer, devLoop func() error) error

WatchForChanges listens to a trigger, and when one is received, computes file changes and conditionally runs the dev loop.

type SkaffoldRunner

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

SkaffoldRunner is responsible for running the skaffold build, test and deploy config.

func NewForConfig

func NewForConfig(ctx context.Context, runCtx *runcontext.RunContext) (*SkaffoldRunner, error)

NewForConfig returns a new SkaffoldRunner for a SkaffoldConfig

func (*SkaffoldRunner) Apply

func (r *SkaffoldRunner) Apply(ctx context.Context, out io.Writer) error

Apply sends Kubernetes manifests to the cluster.

func (*SkaffoldRunner) Cleanup

func (r *SkaffoldRunner) Cleanup(ctx context.Context, out io.Writer, dryRun bool, manifestListByConfig manifest.ManifestListByConfig, command string) error

func (*SkaffoldRunner) Deploy

func (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error

func (*SkaffoldRunner) DeployAndLog

func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact, list manifest.ManifestListByConfig) error

DeployAndLog deploys a list of already built artifacts and optionally show the logs.

func (*SkaffoldRunner) DeployManifests

func (r *SkaffoldRunner) DeployManifests() manifest.ManifestListByConfig

DeployManifests returns a list of manifest if this runner has deployed something.

func (*SkaffoldRunner) Dev

func (r *SkaffoldRunner) Dev(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) error

Dev watches for changes and runs the skaffold build, test and deploy config until interrupted by the user.

func (*SkaffoldRunner) Exec added in v2.4.0

func (r *SkaffoldRunner) Exec(ctx context.Context, out io.Writer, artifacts []graph.Artifact, action string) error

func (*SkaffoldRunner) GeneratePipeline

func (r *SkaffoldRunner) GeneratePipeline(ctx context.Context, out io.Writer, configs []util.VersionedConfig, configPaths []string, fileOut string) error

func (*SkaffoldRunner) Render

func (r *SkaffoldRunner) Render(ctx context.Context, out io.Writer, builds []graph.Artifact, offline bool) (manifest.ManifestListByConfig, error)

func (*SkaffoldRunner) Test

func (r *SkaffoldRunner) Test(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error

func (*SkaffoldRunner) Verify

func (r *SkaffoldRunner) Verify(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error

func (*SkaffoldRunner) VerifyAndLog

func (r *SkaffoldRunner) VerifyAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error

VerifyAndLog deploys a list of already built artifacts and optionally show the logs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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