Documentation ¶
Index ¶
- Constants
- func GetDevContainer(spec *apiv1.PodSpec, containerName string) *apiv1.Container
- func GetRunningPodInLoop(ctx context.Context, dev *model.Dev, app App, c kubernetes.Interface) (*apiv1.Pod, error)
- func GetTranslations(ctx context.Context, dev *model.Dev, app App, reset bool, ...) (map[string]*Translation, error)
- func IsDevModeOn(app App) bool
- func ListDevModeOn(ctx context.Context, manifest *model.Manifest, c kubernetes.Interface) []string
- func SetLastBuiltAnnotation(app App)
- func TranslateContainerSecurityContext(c *apiv1.Container, s *model.SecurityContext)
- func TranslateDevContainer(c *apiv1.Container, rule *model.TranslationRule)
- func TranslateDevMode(trMap map[string]*Translation) error
- func TranslateDevTolerations(spec *apiv1.PodSpec, tolerations []apiv1.Toleration)
- func TranslateEnvVars(c *apiv1.Container, rule *model.TranslationRule)
- func TranslateLifecycle(c *apiv1.Container, l *model.Lifecycle)
- func TranslateOktetoAffinity(spec *apiv1.PodSpec, affinity *apiv1.Affinity)
- func TranslateOktetoBinVolume(spec *apiv1.PodSpec)
- func TranslateOktetoBinVolumeMounts(c *apiv1.Container)
- func TranslateOktetoDevSecret(spec *apiv1.PodSpec, secret string, secrets []model.Secret)
- func TranslateOktetoInitBinContainer(rule *model.TranslationRule, spec *apiv1.PodSpec)
- func TranslateOktetoInitFromImageContainer(spec *apiv1.PodSpec, rule *model.TranslationRule)
- func TranslateOktetoNodeSelector(spec *apiv1.PodSpec, nodeSelector map[string]string)
- func TranslateOktetoSyncSecret(spec *apiv1.PodSpec, name string)
- func TranslateOktetoVolumes(spec *apiv1.PodSpec, rule *model.TranslationRule)
- func TranslatePodAffinity(spec *apiv1.PodSpec, name string)
- func TranslatePodSecurityContext(spec *apiv1.PodSpec, s *model.SecurityContext)
- func TranslatePodServiceAccount(spec *apiv1.PodSpec, sa string)
- func TranslatePodSpec(podSpec *apiv1.PodSpec, rule *model.TranslationRule)
- func TranslateProbes(c *apiv1.Container, p *model.Probes)
- func TranslateResources(c *apiv1.Container, rr model.ResourceRequirements)
- func TranslateVolumeMounts(c *apiv1.Container, rule *model.TranslationRule)
- func ValidateMountPaths(spec *apiv1.PodSpec, dev *model.Dev) error
- type App
- type DeploymentApp
- func (i *DeploymentApp) CheckConditionErrors(dev *model.Dev) error
- func (i *DeploymentApp) Deploy(ctx context.Context, c kubernetes.Interface) error
- func (i *DeploymentApp) Destroy(ctx context.Context, c kubernetes.Interface) error
- func (i *DeploymentApp) DevClone() App
- func (i *DeploymentApp) GetDevClone(ctx context.Context, c kubernetes.Interface) (App, error)
- func (i *DeploymentApp) GetRunningPod(ctx context.Context, c kubernetes.Interface) (*apiv1.Pod, error)
- func (i *DeploymentApp) Kind() string
- func (i *DeploymentApp) ObjectMeta() metav1.ObjectMeta
- func (i *DeploymentApp) PatchAnnotations(ctx context.Context, c kubernetes.Interface) error
- func (i *DeploymentApp) PodSpec() *apiv1.PodSpec
- func (i *DeploymentApp) Refresh(ctx context.Context, c kubernetes.Interface) error
- func (i *DeploymentApp) Replicas() int32
- func (i *DeploymentApp) RestoreOriginal() error
- func (i *DeploymentApp) SetReplicas(n int32)
- func (i *DeploymentApp) TemplateObjectMeta() metav1.ObjectMeta
- func (i *DeploymentApp) Watch(ctx context.Context, result chan error, c kubernetes.Interface)
- type ErrApplicationNotFound
- type StatefulSetApp
- func (i *StatefulSetApp) CheckConditionErrors(dev *model.Dev) error
- func (i *StatefulSetApp) Deploy(ctx context.Context, c kubernetes.Interface) error
- func (i *StatefulSetApp) Destroy(ctx context.Context, c kubernetes.Interface) error
- func (i *StatefulSetApp) DevClone() App
- func (i *StatefulSetApp) GetDevClone(ctx context.Context, c kubernetes.Interface) (App, error)
- func (i *StatefulSetApp) GetRunningPod(ctx context.Context, c kubernetes.Interface) (*apiv1.Pod, error)
- func (i *StatefulSetApp) Kind() string
- func (i *StatefulSetApp) ObjectMeta() metav1.ObjectMeta
- func (i *StatefulSetApp) PatchAnnotations(ctx context.Context, c kubernetes.Interface) error
- func (i *StatefulSetApp) PodSpec() *apiv1.PodSpec
- func (i *StatefulSetApp) Refresh(ctx context.Context, c kubernetes.Interface) error
- func (i *StatefulSetApp) Replicas() int32
- func (i *StatefulSetApp) RestoreOriginal() error
- func (i *StatefulSetApp) SetReplicas(n int32)
- func (i *StatefulSetApp) TemplateObjectMeta() metav1.ObjectMeta
- func (i *StatefulSetApp) Watch(ctx context.Context, result chan error, c kubernetes.Interface)
- type Translation
Constants ¶
const ( // OktetoBinName name of the okteto bin init container OktetoBinName = "okteto-bin" // OktetoInitVolumeContainerName name of the okteto init container that initializes the persistent colume from image content OktetoInitVolumeContainerName = "okteto-init-volume" )
Variables ¶
This section is empty.
Functions ¶
func GetDevContainer ¶
func GetRunningPodInLoop ¶
func GetRunningPodInLoop(ctx context.Context, dev *model.Dev, app App, c kubernetes.Interface) (*apiv1.Pod, error)
GetRunningPodInLoop returns the dev pod for an app and loops until it success
func GetTranslations ¶
func GetTranslations(ctx context.Context, dev *model.Dev, app App, reset bool, c kubernetes.Interface) (map[string]*Translation, error)
GetTranslations fills all the deployments pointed by a development container
func IsDevModeOn ¶
IsDevModeOn returns if a statefulset is in devmode
func ListDevModeOn ¶
ListDevModeOn returns a list of strings with the names of deployments or statefulsets in DevMode. If no app is found in dev mode, an empty slice is returned
func SetLastBuiltAnnotation ¶
func SetLastBuiltAnnotation(app App)
SetLastBuiltAnnotation sets the app timestamp
func TranslateContainerSecurityContext ¶
func TranslateContainerSecurityContext(c *apiv1.Container, s *model.SecurityContext)
TranslateContainerSecurityContext translates the security context attached to a container
func TranslateDevContainer ¶
func TranslateDevContainer(c *apiv1.Container, rule *model.TranslationRule)
TranslateDevContainer translates a dev container
func TranslateDevMode ¶
func TranslateDevMode(trMap map[string]*Translation) error
TranslateDevMode translates the deployment manifests to put them in dev mode
func TranslateDevTolerations ¶
func TranslateDevTolerations(spec *apiv1.PodSpec, tolerations []apiv1.Toleration)
TranslateDevTolerations sets the user provided toleretions
func TranslateEnvVars ¶
func TranslateEnvVars(c *apiv1.Container, rule *model.TranslationRule)
TranslateEnvVars translates the variables attached to a container
func TranslateLifecycle ¶
TranslateLifecycle translates the lifecycle events attached to a container
func TranslateOktetoAffinity ¶
func TranslateOktetoBinVolume ¶
TranslateOktetoBinVolume translates the binaries volume attached to a container
func TranslateOktetoBinVolumeMounts ¶
TranslateOktetoBinVolumeMounts translates the binaries mount attached to a container
func TranslateOktetoDevSecret ¶
TranslateOktetoDevSecret translates the devs secret of a pod
func TranslateOktetoInitBinContainer ¶
func TranslateOktetoInitBinContainer(rule *model.TranslationRule, spec *apiv1.PodSpec)
TranslateOktetoInitBinContainer translates the bin init container of a pod
func TranslateOktetoInitFromImageContainer ¶
func TranslateOktetoInitFromImageContainer(spec *apiv1.PodSpec, rule *model.TranslationRule)
TranslateOktetoInitFromImageContainer translates the init from image container of a pod
func TranslateOktetoSyncSecret ¶
TranslateOktetoSyncSecret translates the syncthing secret container of a pod
func TranslateOktetoVolumes ¶
func TranslateOktetoVolumes(spec *apiv1.PodSpec, rule *model.TranslationRule)
TranslateOktetoVolumes translates the dev volumes
func TranslatePodAffinity ¶
TranslatePodAffinity translates the affinity of pod to be all on the same node
func TranslatePodSecurityContext ¶
func TranslatePodSecurityContext(spec *apiv1.PodSpec, s *model.SecurityContext)
TranslatePodSecurityContext translates the security context attached to a pod
func TranslatePodServiceAccount ¶
TranslatePodServiceAccount translates the security account the pod uses
func TranslatePodSpec ¶
func TranslatePodSpec(podSpec *apiv1.PodSpec, rule *model.TranslationRule)
func TranslateProbes ¶
TranslateProbes translates the probes attached to a container
func TranslateResources ¶
func TranslateResources(c *apiv1.Container, rr model.ResourceRequirements)
TranslateResources translates the resources attached to a container
func TranslateVolumeMounts ¶
func TranslateVolumeMounts(c *apiv1.Container, rule *model.TranslationRule)
TranslateVolumeMounts translates the volumes attached to a container
Types ¶
type App ¶
type App interface { Kind() string ObjectMeta() metav1.ObjectMeta Replicas() int32 SetReplicas(n int32) TemplateObjectMeta() metav1.ObjectMeta PodSpec() *apiv1.PodSpec // DevClone() creates in memory a clone of the app for dev mode DevClone() App CheckConditionErrors(dev *model.Dev) error GetRunningPod(ctx context.Context, c kubernetes.Interface) (*apiv1.Pod, error) // TODO: remove after people move to CLI >= 1.14 RestoreOriginal() error // GetDevClone returns the cloned app from Kubernetes GetDevClone(ctx context.Context, c kubernetes.Interface) (App, error) Refresh(ctx context.Context, c kubernetes.Interface) error Watch(ctx context.Context, result chan error, c kubernetes.Interface) Deploy(ctx context.Context, c kubernetes.Interface) error PatchAnnotations(ctx context.Context, c kubernetes.Interface) error Destroy(ctx context.Context, c kubernetes.Interface) error }
type DeploymentApp ¶
type DeploymentApp struct {
// contains filtered or unexported fields
}
func NewDeploymentApp ¶
func NewDeploymentApp(d *appsv1.Deployment) *DeploymentApp
func (*DeploymentApp) CheckConditionErrors ¶
func (i *DeploymentApp) CheckConditionErrors(dev *model.Dev) error
func (*DeploymentApp) Deploy ¶
func (i *DeploymentApp) Deploy(ctx context.Context, c kubernetes.Interface) error
func (*DeploymentApp) Destroy ¶
func (i *DeploymentApp) Destroy(ctx context.Context, c kubernetes.Interface) error
func (*DeploymentApp) DevClone ¶
func (i *DeploymentApp) DevClone() App
func (*DeploymentApp) GetDevClone ¶
func (i *DeploymentApp) GetDevClone(ctx context.Context, c kubernetes.Interface) (App, error)
GetDevClone Returns from Kubernetes the cloned deployment
func (*DeploymentApp) GetRunningPod ¶
func (i *DeploymentApp) GetRunningPod(ctx context.Context, c kubernetes.Interface) (*apiv1.Pod, error)
func (*DeploymentApp) Kind ¶
func (i *DeploymentApp) Kind() string
func (*DeploymentApp) ObjectMeta ¶
func (i *DeploymentApp) ObjectMeta() metav1.ObjectMeta
func (*DeploymentApp) PatchAnnotations ¶
func (i *DeploymentApp) PatchAnnotations(ctx context.Context, c kubernetes.Interface) error
func (*DeploymentApp) PodSpec ¶
func (i *DeploymentApp) PodSpec() *apiv1.PodSpec
func (*DeploymentApp) Refresh ¶
func (i *DeploymentApp) Refresh(ctx context.Context, c kubernetes.Interface) error
func (*DeploymentApp) Replicas ¶
func (i *DeploymentApp) Replicas() int32
func (*DeploymentApp) RestoreOriginal ¶
func (i *DeploymentApp) RestoreOriginal() error
func (*DeploymentApp) SetReplicas ¶
func (i *DeploymentApp) SetReplicas(n int32)
func (*DeploymentApp) TemplateObjectMeta ¶
func (i *DeploymentApp) TemplateObjectMeta() metav1.ObjectMeta
func (*DeploymentApp) Watch ¶
func (i *DeploymentApp) Watch(ctx context.Context, result chan error, c kubernetes.Interface)
type ErrApplicationNotFound ¶
type ErrApplicationNotFound struct {
Name string
}
func (ErrApplicationNotFound) Error ¶
func (e ErrApplicationNotFound) Error() string
type StatefulSetApp ¶
type StatefulSetApp struct {
// contains filtered or unexported fields
}
func NewStatefulSetApp ¶
func NewStatefulSetApp(sfs *appsv1.StatefulSet) *StatefulSetApp
func (*StatefulSetApp) CheckConditionErrors ¶
func (i *StatefulSetApp) CheckConditionErrors(dev *model.Dev) error
func (*StatefulSetApp) Deploy ¶
func (i *StatefulSetApp) Deploy(ctx context.Context, c kubernetes.Interface) error
func (*StatefulSetApp) Destroy ¶
func (i *StatefulSetApp) Destroy(ctx context.Context, c kubernetes.Interface) error
func (*StatefulSetApp) DevClone ¶
func (i *StatefulSetApp) DevClone() App
func (*StatefulSetApp) GetDevClone ¶
func (i *StatefulSetApp) GetDevClone(ctx context.Context, c kubernetes.Interface) (App, error)
GetDevClone Returns from Kubernetes the cloned statefulset
func (*StatefulSetApp) GetRunningPod ¶
func (i *StatefulSetApp) GetRunningPod(ctx context.Context, c kubernetes.Interface) (*apiv1.Pod, error)
func (*StatefulSetApp) Kind ¶
func (i *StatefulSetApp) Kind() string
func (*StatefulSetApp) ObjectMeta ¶
func (i *StatefulSetApp) ObjectMeta() metav1.ObjectMeta
func (*StatefulSetApp) PatchAnnotations ¶
func (i *StatefulSetApp) PatchAnnotations(ctx context.Context, c kubernetes.Interface) error
func (*StatefulSetApp) PodSpec ¶
func (i *StatefulSetApp) PodSpec() *apiv1.PodSpec
func (*StatefulSetApp) Refresh ¶
func (i *StatefulSetApp) Refresh(ctx context.Context, c kubernetes.Interface) error
func (*StatefulSetApp) Replicas ¶
func (i *StatefulSetApp) Replicas() int32
func (*StatefulSetApp) RestoreOriginal ¶
func (i *StatefulSetApp) RestoreOriginal() error
func (*StatefulSetApp) SetReplicas ¶
func (i *StatefulSetApp) SetReplicas(n int32)
func (*StatefulSetApp) TemplateObjectMeta ¶
func (i *StatefulSetApp) TemplateObjectMeta() metav1.ObjectMeta
func (*StatefulSetApp) Watch ¶
func (i *StatefulSetApp) Watch(ctx context.Context, result chan error, c kubernetes.Interface)
type Translation ¶
type Translation struct { MainDev *model.Dev Dev *model.Dev App App DevApp App Rules []*model.TranslationRule }
Translation represents the information for translating an application
func (*Translation) DevModeOff ¶
func (tr *Translation) DevModeOff() error