kube

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelmChartResource = schema.GroupVersionResource{
		Group:    "helm.cattle.io",
		Version:  "v1",
		Resource: "helmcharts",
	}
	FluxHelmReleaseResource = schema.GroupVersionResource{
		Group:    "helm.toolkit.fluxcd.io",
		Version:  "v2beta1",
		Resource: "helmreleases",
	}
)

Functions

func ConvertVolume added in v0.0.3

func ConvertVolume(cw ClientWrapper, resourceNamespace, resourceName string, volume *corev1.PersistentVolume, patcher Patcher) (err error)

func GetKubeconfig added in v0.0.3

func GetKubeconfig() (*rest.Config, error)

func WaitFor

func WaitFor(condition wait.ConditionFunc) error

Types

type ClientWrapper

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

func GetClientWrapper

func GetClientWrapper(config *rest.Config) ClientWrapper

func (*ClientWrapper) AddTempPVC

func (cw *ClientWrapper) AddTempPVC(patcher Patcher, namespace, chartName, pvcName, volumeSize string) (string, error)

func (*ClientWrapper) CleanupMigrationObjects added in v0.0.3

func (cw *ClientWrapper) CleanupMigrationObjects() error

func (*ClientWrapper) CreateJob

func (cw *ClientWrapper) CreateJob(namespace string, job *batchv1.Job) (string, error)

func (*ClientWrapper) CreateMigrationNamespaceAndServiceAccount added in v0.0.3

func (cw *ClientWrapper) CreateMigrationNamespaceAndServiceAccount() error

func (*ClientWrapper) CreateNamespace

func (cw *ClientWrapper) CreateNamespace(name string) error

func (*ClientWrapper) CreateServiceAccount

func (cw *ClientWrapper) CreateServiceAccount(namespace, name string) error

func (*ClientWrapper) DeleteCRB

func (cw *ClientWrapper) DeleteCRB(name string) error

func (*ClientWrapper) DeleteNamespace

func (cw *ClientWrapper) DeleteNamespace(name string) error

func (*ClientWrapper) DeletePVC

func (cw *ClientWrapper) DeletePVC(namespace, name string) error

func (*ClientWrapper) GetNamespaces

func (cw *ClientWrapper) GetNamespaces() ([]corev1.Namespace, error)

func (*ClientWrapper) GetPVByName added in v0.0.3

func (cw *ClientWrapper) GetPVByName(name string) (*corev1.PersistentVolume, error)

func (*ClientWrapper) GetPVCByName added in v0.0.3

func (cw *ClientWrapper) GetPVCByName(namespace, name string) (*corev1.PersistentVolumeClaim, error)

func (*ClientWrapper) GetPVCsByResourceName added in v0.0.3

func (cw *ClientWrapper) GetPVCsByResourceName(namespace, name string) ([]corev1.PersistentVolumeClaim, error)

func (*ClientWrapper) GetPodByName

func (cw *ClientWrapper) GetPodByName(namespace, name string) (corev1.Pod, error)

func (*ClientWrapper) GetResourceList

func (cw *ClientWrapper) GetResourceList(namespace string, resource schema.GroupVersionResource) ([]unstructured.Unstructured, error)

func (*ClientWrapper) IsJobFinished

func (cw *ClientWrapper) IsJobFinished(namespace, name string) wait.ConditionFunc

func (*ClientWrapper) IsPVCBound

func (cw *ClientWrapper) IsPVCBound(namespace, pvcName string) wait.ConditionFunc

func (*ClientWrapper) IsPodReady

func (cw *ClientWrapper) IsPodReady(namespace, name string) wait.ConditionFunc

func (*ClientWrapper) MigrateJob

func (cw *ClientWrapper) MigrateJob(namespace, fromPVC, toPVC string) (string, error)

TODO need -d on second write? https://github.com/utkuozdemir/pv-migrate/blob/master/USAGE.md

func (*ClientWrapper) ScaleDeployment

func (cw *ClientWrapper) ScaleDeployment(namespace, name string, replicas int) error

func (*ClientWrapper) UnbindTempPVC

func (cw *ClientWrapper) UnbindTempPVC(patcher Patcher, namespace, chartName, pvcName string) error

func (*ClientWrapper) UpdateOriginalPVC

func (cw *ClientWrapper) UpdateOriginalPVC(patcher Patcher, namespace, chartName, pvcName string) error

type HelmChartPatcher

type HelmChartPatcher struct{}

func (HelmChartPatcher) GetNamespacePath added in v0.0.3

func (hcp HelmChartPatcher) GetNamespacePath() []string

type HelmReleasePatcher

type HelmReleasePatcher struct{}

func (HelmReleasePatcher) GetNamespacePath added in v0.0.3

func (hrp HelmReleasePatcher) GetNamespacePath() []string

type Patcher

type Patcher interface {
	GetNamespacePath() []string
	// contains filtered or unexported methods
}

func NewPatcher

func NewPatcher(resourceType string) (Patcher, error)

Jump to

Keyboard shortcuts

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