deploy

package
v0.0.0-...-5cb69d1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deploy

func Deploy(ctx context.Context, at AnalyticsTrackerInterface, insightsTracker buildDeployTrackerInterface, ioCtrl *io.Controller, k8sLogger *io.K8sLogger) *cobra.Command

Deploy deploys the okteto manifest

func Endpoints

func Endpoints(ctx context.Context, k8sLogger *io.K8sLogger) *cobra.Command

Endpoints lists the endpoints for a development environment

func GetCommandFlags

func GetCommandFlags(name string, vars []string) ([]string, error)

func GetDependencyEnvVars

func GetDependencyEnvVars(environGetter environGetter) map[string]string

GetDependencyEnvVars This function gets the variables defined by the dependencies (OKTETO_DEPENDENCY_XXXX) deployed before the deploy phase from the environment. This function is here as the command is the one in charge of deploying dependencies and trigger the rest of the deploy phase.

func NewEndpointGetterInStandaloneMode

func NewEndpointGetterInStandaloneMode(k8sLogger *io.K8sLogger) *endpointGetterInStandaloneMode

func NewEndpointGetterWithOktetoAPI

func NewEndpointGetterWithOktetoAPI(c *okteto.Client) *endpointGetterWithOktetoAPI

Types

type AnalyticsTrackerInterface

type AnalyticsTrackerInterface interface {
	TrackDeploy(dm analytics.DeployMetadata)
	// contains filtered or unexported methods
}

type Command

type Command struct {
	GetManifest       func(path string, fs afero.Fs) (*model.Manifest, error)
	K8sClientProvider okteto.K8sClientProviderWithLogger
	Builder           builderInterface
	GetDeployer       getDeployerFunc
	EndpointGetter    func(k8sLogger *io.K8sLogger) (EndpointGetter, error)
	DeployWaiter      Waiter
	CfgMapHandler     ConfigMapHandler
	Fs                afero.Fs
	PipelineCMD       pipelineCMD.DeployerInterface
	AnalyticsTracker  AnalyticsTrackerInterface
	IoCtrl            *io.Controller
	K8sLogger         *io.K8sLogger
	InsightsTracker   buildDeployTrackerInterface

	PipelineType model.Archetype

	IsRemote           bool
	RunningInInstaller bool
	// contains filtered or unexported fields
}

Command defines the config for deploying an app

func (*Command) Run

func (dc *Command) Run(ctx context.Context, deployOptions *Options) error

Run runs the deploy sequence

func (*Command) TrackDeploy

func (dc *Command) TrackDeploy(manifest *model.Manifest, runInRemoteFlag bool, startTime time.Time, err error)

type ConfigMapHandler

type ConfigMapHandler interface {
	TranslateConfigMapAndDeploy(context.Context, *pipeline.CfgData) (*apiv1.ConfigMap, error)
	UpdateConfigMap(context.Context, *apiv1.ConfigMap, *pipeline.CfgData, error) error
	UpdateEnvsFromCommands(context.Context, string, string, []string) error
	GetConfigmapVariablesEncoded(ctx context.Context, name, namespace string) (string, error)
	AddPhaseDuration(context.Context, string, string, string, time.Duration) error
}

ConfigMapHandler defines the different functions to run okteto inside an okteto deploy or an okteto destroy directly

func NewConfigmapHandler

func NewConfigmapHandler(provider okteto.K8sClientProviderWithLogger, k8slogger *io.K8sLogger) ConfigMapHandler

type Deployer

type Deployer interface {
	Deploy(context.Context, *Options) error
	CleanUp(ctx context.Context, err error)
}

Deployer defines the operations to deploy the custom commands, divert and external resources defined in an Okteto manifest

func GetDeployer

func GetDeployer(ctx context.Context,
	opts *Options,
	buildEnvVarsGetter buildEnvVarsGetter,
	cmapHandler ConfigMapHandler,
	k8sProvider okteto.K8sClientProviderWithLogger,
	ioCtrl *io.Controller,
	k8Logger *io.K8sLogger,
	dependencyEnvVarsGetter dependencyEnvVarsGetter,
) (Deployer, error)

GetDeployer returns a remote or a local deployer k8sProvider, kubeconfig and portGetter should not be nil values

type EndpointGetter

type EndpointGetter struct {
	GetManifest func(path string, fs afero.Fs) (*model.Manifest, error)
	// contains filtered or unexported fields
}

func NewEndpointGetter

func NewEndpointGetter(k8sLogger *io.K8sLogger) (EndpointGetter, error)

type EndpointsOptions

type EndpointsOptions struct {
	Name         string
	ManifestPath string
	Output       string
	Namespace    string
	K8sContext   string
}

EndpointsOptions defines the options to get the endpoints

type Namer

type Namer struct {
	Workdir      string
	KubeClient   kubernetes.Interface
	ManifestName string
	ManifestPath string
}

func (Namer) ResolveName

func (na Namer) ResolveName(ctx context.Context) string

type Options

type Options struct {
	Manifest *model.Manifest
	// ManifestPathFlag is the option -f as introduced by the user when executing this command.
	// This is stored at the configmap as filename to redeploy from the ui.
	ManifestPathFlag string
	// ManifestPath is the path to the manifest used though the command execution.
	// This might change its value during execution
	ManifestPath     string
	Name             string
	Namespace        string
	K8sContext       string
	Variables        []string
	ServicesToDeploy []string
	Timeout          time.Duration
	Build            bool
	Dependencies     bool
	RunWithoutBash   bool
	RunInRemote      bool
	Wait             bool
	ShowCTA          bool
}

Options represents options for deploy command

type Waiter

type Waiter struct {
	K8sClientProvider okteto.K8sClientProviderWithLogger
	K8sLogger         *ioCtrl.K8sLogger
}

func NewDeployWaiter

func NewDeployWaiter(k8sClientProvider okteto.K8sClientProviderWithLogger, k8slogger *ioCtrl.K8sLogger) Waiter

Jump to

Keyboard shortcuts

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