Documentation ¶
Index ¶
- func GetTempKubeConfigFile(name string) string
- func NewEnvStepper(filename string) *envStepper
- type ConfigMapHandler
- type DeployParameters
- type DeployRunner
- type DestroyParameters
- type DestroyRunner
- type DivertDeployer
- type Entity
- type ExternalResourceInterface
- type KubeConfig
- type KubeConfigHandler
- type PortGetterFunc
- type Proxy
- type ProxyInterface
- type TestParameters
- type TestRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTempKubeConfigFile ¶
GetTempKubeConfigFile returns where the temp kubeConfigFile for deploy should be stored
func NewEnvStepper ¶
func NewEnvStepper(filename string) *envStepper
Types ¶
type ConfigMapHandler ¶
type ConfigMapHandler interface { UpdateEnvsFromCommands(context.Context, string, string, []string) error AddPhaseDuration(context.Context, string, string, string, time.Duration) error }
ConfigMapHandler defines the operations to handle the ConfigMap with the information related to the development environment
type DeployParameters ¶
type DeployParameters struct { Name string Namespace string ManifestPath string Deployable Entity Variables []string }
DeployParameters represents the parameters for deploying a remote entity
type DeployRunner ¶
type DeployRunner struct { Proxy ProxyInterface Kubeconfig KubeConfigHandler ConfigMapHandler ConfigMapHandler Executor executor.ManifestExecutor K8sClientProvider okteto.K8sClientProviderWithLogger Fs afero.Fs DivertDeployer DivertDeployer GetExternalControl func(cfg *rest.Config) ExternalResourceInterface TempKubeconfigFile string // contains filtered or unexported fields }
DeployRunner is responsible for running the commands defined in a manifest, deploy the divert information and deploy external resources. This DeployRunner has the common functionality to deal with the mentioned resources when deploy is run locally or remotely. As this runs also in the remote, it should NEVER build any kind of image or execute some logic that might differ from local.
func NewDeployRunnerForLocal ¶
func NewDeployRunnerForLocal( ctx context.Context, name string, runWithoutBash bool, manifestPathFlag string, cmapHandler ConfigMapHandler, k8sProvider okteto.K8sClientProviderWithLogger, portGetter PortGetterFunc, k8sLogger *io.K8sLogger, ) (*DeployRunner, error)
NewDeployRunnerForLocal initializes a runner for a local environment. The main difference with the remote initialization is that the name might be empty in the local runner and it has to be inferred.
func NewDeployRunnerForRemote ¶
func NewDeployRunnerForRemote( name string, runWithoutBash bool, cmapHandler ConfigMapHandler, k8sProvider okteto.K8sClientProviderWithLogger, portGetter PortGetterFunc, k8sLogger *io.K8sLogger, ) (*DeployRunner, error)
NewDeployRunnerForRemote initializes a runner for a remote environment
func (*DeployRunner) CleanUp ¶
func (r *DeployRunner) CleanUp(ctx context.Context, err error)
CleanUp cleans up the resources created by the runner to avoid to leave any temporal resource
func (*DeployRunner) RunDeploy ¶
func (r *DeployRunner) RunDeploy(ctx context.Context, params DeployParameters) error
RunDeploy deploys the deployable received with DeployParameters
type DestroyParameters ¶
type DestroyParameters struct { Name string Namespace string Deployable Entity Variables []string ForceDestroy bool }
DestroyParameters represents the parameters for destroying a remote entity
type DestroyRunner ¶
type DestroyRunner struct {
Executor executor.ManifestExecutor
}
DestroyRunner is responsible for running the commands defined in a manifest when destroying a dev environment This DestroyRunner has the common functionality to deal with the custom commands when destroy is run locally or remotely. As this runs also in the remote, it should NEVER build any kind of image or execute some logic that might differ from local.
func (*DestroyRunner) CleanUp ¶
func (dr *DestroyRunner) CleanUp(err error)
func (*DestroyRunner) RunDestroy ¶
func (dr *DestroyRunner) RunDestroy(params DestroyParameters) error
RunDestroy executes the custom commands received as part of DestroyParameters
type DivertDeployer ¶
DivertDeployer defines the operations to deploy the divert section of a deployable
type Entity ¶
type Entity struct { External externalresource.Section Divert *model.DivertDeploy Commands []model.DeployCommand }
Entity represents a set of resources that can be deployed by the runner
type ExternalResourceInterface ¶
type ExternalResourceInterface interface {
Deploy(ctx context.Context, name string, ns string, externalInfo *externalresource.ExternalResource) error
}
ExternalResourceInterface defines the operations to work with external resources
type KubeConfig ¶
type KubeConfig struct{}
KubeConfig refers to a KubeConfig object
func (*KubeConfig) GetCMDAPIConfig ¶
func (*KubeConfig) GetCMDAPIConfig() (*clientcmdapi.Config, error)
type KubeConfigHandler ¶
type KubeConfigHandler interface { Read() (*rest.Config, error) Modify(port int, sessionToken, destKubeconfigFile string) error }
KubeConfigHandler defines the operations to handle the kubeconfig file needed to deal with the local Kubernetes proxy
type PortGetterFunc ¶
PortGetterFunc is a function that retrieves a free port the port for specified interface
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy refers to a proxy configuration
func NewProxy ¶
func NewProxy(kubeconfig KubeConfigHandler, portGetter PortGetterFunc) (*Proxy, error)
NewProxy creates a new proxy
func (*Proxy) SetName ¶
SetName sets the name to be in the deployed-by label name is sanitized when passing the parameter
type ProxyInterface ¶
type ProxyInterface interface { Start() Shutdown(ctx context.Context) error GetPort() int GetToken() string SetName(name string) SetDivert(driver divert.Driver) }
ProxyInterface defines the different operations to work with the proxy run by Okteto
type TestParameters ¶
type TestParameters struct { Name string Namespace string DevEnvName string Deployable Entity Variables []string ForceDestroy bool }
TestParameters represents the parameters for destroying a remote entity
type TestRunner ¶
type TestRunner struct { Executor executor.ManifestExecutor Fs afero.Fs GetDevEnvEnviron func(devEnvName, namespace string) (map[string]string, error) SetDevEnvEnviron func(devEnvName, namespace string, vars []string) error }
TestRunner is responsible for running the commands defined in a manifest when running tests
func (*TestRunner) RunTest ¶
func (dr *TestRunner) RunTest(params TestParameters) error
RunTest executes the custom commands received as part of TestParameters