Documentation ¶
Index ¶
- Constants
- Variables
- func DockerCleanup(ctx context.Context, labelIdentifier string) error
- func GetRuntimeSecretData(ctx context.Context, kubeCtx string, ns string) (map[string][]byte, error)
- func RESTConfigFromDefaults(currentCtx string) (*rest.Config, error)
- type BuildOptions
- type BuildOutput
- type BuildPlan
- type Builder
- type ChartConfig
- type DeployOptions
- type DeployOutput
- type DeployPlan
- type Deployer
- type DownOptions
- type HelmOptions
- type ImageRegistry
- type LaunchPad
- type LocalImage
- type LocalOptions
- type Pad
- func (p *Pad) Build(ctx context.Context, opts *BuildOptions) (*BuildOutput, error)
- func (p *Pad) CreateAndStartContainerInLocalMode(ctx context.Context, opts *LocalOptions) (err error)
- func (p *Pad) Deploy(ctx context.Context, opts *DeployOptions) (*DeployOutput, error)
- func (p *Pad) Down(ctx context.Context, do *DownOptions) error
- func (p *Pad) PortForward(ctx context.Context, opts *PortForwardOptions) error
- func (p *Pad) Publish(ctx context.Context, opts *PublishOptions) (*PublishOutput, error)
- func (p *Pad) RunLocally(ctx context.Context, opts *LocalOptions) error
- func (p *Pad) TailLogs(ctx context.Context, kubeCtx string, do *DeployOutput) error
- func (p *Pad) TailLogsForAppExec(ctx context.Context, kubeCtx string, do *DeployOutput) error
- func (p *Pad) TailLogsOnErr(ctx context.Context, kubeCtx string, do *DeployOutput) error
- func (p *Pad) ToManifest() error
- type PortForwardOptions
- type PublishImagePlan
- type PublishOptions
- type PublishOutput
- type PublishPlan
- type Publisher
Constants ¶
const ( AppChartName = "app" RuntimeChartName = "jetpack-runtime" ApiKeySecretName = "api-key-secret" )
const ( PortFwdTargetApp = "app" PortFwdTargetRuntime = "runtime" )
We could make this a pseudo-string-enum via: type PortFwdTarget string
Variables ¶
var ErrPodContainerError = errorutil.NewUserError("deployment failed because of container error")
var MsgUsingProdTrialClusterWhenLoggedOut = "Your kubeconfig is using the trial cluster but you are not logged" +
"-in. Please do `launchpad auth login` and try again."
Functions ¶
func DockerCleanup ¶
DockerCleanup deletes all docker images that are not the latest based on timestamp. This will only delete the images that belong to the current project.
func GetRuntimeSecretData ¶
Types ¶
type BuildOptions ¶
type BuildOptions struct { AppName string BuildArgs map[string]string LifecycleHook hook.LifecycleHook // Pre-built local image to use LocalImage string // ProjectDir is the absolute path to the module ProjectDir string ProjectId string // Platform informs docker which architecture to build for. // Examples: linux/arm64 (for M1 macs) linux/amd64 (for intel macs) Platform string Services map[string]jetconfig.Builder RemoteCache bool RepoConfig provider.RepoConfig // required for remote cache feature ImageRepoForCache string TagPrefix string }
func (*BuildOptions) GetBuilders ¶
func (b *BuildOptions) GetBuilders() map[string]jetconfig.Builder
func (*BuildOptions) GetRepoHost ¶
func (b *BuildOptions) GetRepoHost() string
type BuildOutput ¶
type BuildOutput struct { Duration time.Duration Image *LocalImage }
func (*BuildOutput) DidBuildUsingDockerfile ¶
func (o *BuildOutput) DidBuildUsingDockerfile() bool
func (*BuildOutput) SetDuration ¶
func (o *BuildOutput) SetDuration(d time.Duration)
type Builder ¶
type Builder interface {
Build(ctx context.Context, opts *BuildOptions) (*BuildOutput, error)
}
This file has the public interface to the launchpad package
type ChartConfig ¶
type ChartConfig struct { Repo string Name string Namespace string Release string // unique identifier for installation (can be same or different from display name) Timeout gotime.Duration Wait bool // contains filtered or unexported fields }
func (*ChartConfig) HumanName ¶
func (c *ChartConfig) HumanName() string
type DeployOptions ¶
type DeployOptions struct { App *HelmOptions Environment string // api.Environment ExternalCharts []*ChartConfig IsLocalCluster bool // We should remove this jetconfig dependency. Pass in an interface. This will be easier to design // once we have a few service types implemented, and we understand the concrete // requirements. Leaving jetconfig in for now. JetCfg *jetconfig.Config KubeContext string LifecycleHook hook.LifecycleHook Namespace string CreateNamespace bool RemoteEnvVars map[string]string Runtime *HelmOptions SecretFilePaths []string ReinstallOnHelmUpgradeError bool }
TODO: fix spacing in this struct
type DeployOutput ¶
type DeployOutput struct { Duration gotime.Duration InstanceName string Namespace string Releases map[string]*release.Release // keyed by unique chart name }
func (*DeployOutput) AppPort ¶
func (do *DeployOutput) AppPort() int
func (*DeployOutput) SetDuration ¶
func (do *DeployOutput) SetDuration(d gotime.Duration)
type DeployPlan ¶
type DeployPlan struct { DeployOptions *DeployOptions // contains filtered or unexported fields }
func (*DeployPlan) Charts ¶
func (dp *DeployPlan) Charts() []*ChartConfig
type Deployer ¶
type Deployer interface {
Deploy(ctx context.Context, opts *DeployOptions) (*DeployOutput, error)
}
type DownOptions ¶
type DownOptions struct { ExternalCharts []*ChartConfig ReleaseName string InstanceName string Namespace string KubeContext string }
type HelmOptions ¶
type ImageRegistry ¶
type ImageRegistry struct {
// contains filtered or unexported fields
}
func (*ImageRegistry) GetHost ¶
func (ir *ImageRegistry) GetHost() registryHost
type LocalImage ¶
type LocalImage string
func NewLocalImage ¶
func NewLocalImage(n string) *LocalImage
func (*LocalImage) Name ¶
func (l *LocalImage) Name() string
func (*LocalImage) String ¶
func (l *LocalImage) String() string
func (*LocalImage) Tag ¶
func (l *LocalImage) Tag() string
type LocalOptions ¶
type Pad ¶
type Pad struct {
// contains filtered or unexported fields
}
Pad has the foundational elements on top of which the LaunchPad is constructed.
func NewPad ¶
func NewPad(errorLogger provider.ErrorLogger) *Pad
func NewPadForTest ¶
func NewPadForTest() *Pad
func (*Pad) Build ¶
func (p *Pad) Build( ctx context.Context, opts *BuildOptions, ) (*BuildOutput, error)
Build uses the Dockerfile to build a docker image of the module
func (*Pad) CreateAndStartContainerInLocalMode ¶
func (p *Pad) CreateAndStartContainerInLocalMode(ctx context.Context, opts *LocalOptions) (err error)
func (*Pad) Deploy ¶
func (p *Pad) Deploy( ctx context.Context, opts *DeployOptions, ) (*DeployOutput, error)
Deploy creates kubernetes resources from the Manifest
func (*Pad) PortForward ¶
func (p *Pad) PortForward(ctx context.Context, opts *PortForwardOptions) error
func (*Pad) Publish ¶
func (p *Pad) Publish( ctx context.Context, opts *PublishOptions, ) (*PublishOutput, error)
If an image-registry is specified, Publish will send the docker image built by Build() to a docker-registry TODO(Landau) rename to push so more closely resemble `docker push` and reduce ambiguity with publishing as a means to make something public.
func (*Pad) RunLocally ¶
func (p *Pad) RunLocally( ctx context.Context, opts *LocalOptions, ) error
func (*Pad) TailLogsForAppExec ¶
func (*Pad) TailLogsOnErr ¶
type PortForwardOptions ¶
type PortForwardOptions struct { AppOrRuntime string // 'app' or 'runtime' DeployOut *DeployOutput KubeCtx string PodPort int Target string }
type PublishImagePlan ¶
type PublishImagePlan struct {
// contains filtered or unexported fields
}
type PublishOptions ¶
type PublishOptions struct { AnalyticsProvider provider.Analytics AWSCredentials aws.CredentialsProvider // Required to create ECR repos ImageRepoCredentials string // ImageRegistryWithRepo is <registry-uri>/<repository-path> ImageRegistryWithRepo string LifecycleHook hook.LifecycleHook LocalImages []*LocalImage Region string TagPrefix string }
type PublishOutput ¶
func (*PublishOutput) DidPublish ¶
func (o *PublishOutput) DidPublish() bool
func (*PublishOutput) PublishedImages ¶
func (o *PublishOutput) PublishedImages() map[string]string
func (*PublishOutput) RegistryHost ¶
func (o *PublishOutput) RegistryHost() string
func (*PublishOutput) SetDuration ¶
func (do *PublishOutput) SetDuration(d time.Duration)
type PublishPlan ¶
type PublishPlan struct {
// contains filtered or unexported fields
}
type Publisher ¶
type Publisher interface {
Publish(ctx context.Context, opts *PublishOptions) (*PublishOutput, error)
}