run

package
v0.9.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MPL-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DevBucketContainerImage = "ghcr.io/weaveworks/gitops-bucket-server@sha256:b0446a6c645b5d39cf0db558958bf28363aca3ea80dc9d593983173613a4f290"
)

Functions

func CleanupBucketSourceAndKS

func CleanupBucketSourceAndKS(log logger.Logger, kubeClient *kube.KubeHTTP, namespace string) error

CleanupBucketSourceAndKS removes the bucket source and ks

func EnablePortForwardingForDashboard

func EnablePortForwardingForDashboard(log logger.Logger, kubeClient *kube.KubeHTTP, config *rest.Config, dashboardPort string) (func(), error)

EnablePortForwardingForDashboard enables port forwarding for the GitOps Dashboard.

func FindGitRepoDir

func FindGitRepoDir() (string, error)

FindGitRepoDir finds git repo root directory

func ForwardPort

func ForwardPort(pod *corev1.Pod, cfg *rest.Config, specMap *PortForwardSpec, waitFwd chan struct{}, readyChannel chan struct{}) error

func GetFluxVersion

func GetFluxVersion(log logger.Logger, ctx context.Context, kubeClient *kube.KubeHTTP) (string, error)

func GetKubeClient

func GetKubeClient(log logger.Logger, contextName string, cfg *rest.Config, kubeClientOpts *runclient.Options) (*kube.KubeHTTP, error)

func GetKubeClientOptions

func GetKubeClientOptions() *runclient.Options

func GetKubeConfigArgs

func GetKubeConfigArgs() *genericclioptions.ConfigFlags

func GetPodFromSpecMap

func GetPodFromSpecMap(specMap *PortForwardSpec, kubeClient *kube.KubeHTTP) (*corev1.Pod, error)

func GetRelativePathToRootDir

func GetRelativePathToRootDir(rootDir string, path string) (string, error)

GetRelativePathToRootDir gets relative path to a directory from the git root. It returns an error if there's no git repo.

func InstallDashboard

func InstallDashboard(log logger.Logger, ctx context.Context, kubeClient *kube.KubeHTTP, kubeConfigArgs *genericclioptions.ConfigFlags) error

InstallDashboard installs the GitOps Dashboard.

func InstallDevBucketServer

func InstallDevBucketServer(log logger.Logger, kubeClient *kube.KubeHTTP, config *rest.Config) (func(), error)

InstallDevBucketServer installs the dev bucket server, open port forwarding, and returns a function that can be used to the port forwarding.

func InstallFlux

func InstallFlux(log logger.Logger, ctx context.Context, kubeClient *kube.KubeHTTP, installOptions install.Options, kubeConfigArgs genericclioptions.RESTClientGetter) error

func IsDashboardInstalled

func IsDashboardInstalled(log logger.Logger, ctx context.Context, kubeClient *kube.KubeHTTP) bool

IsDashboardInstalled checks if the GitOps Dashboard is installed.

func IsLocalCluster

func IsLocalCluster(kubeClient *kube.KubeHTTP) bool

IsLocalCluster checks if it's a local cluster. See https://skaffold.dev/docs/environment/local-cluster/

func ReconcileDashboard

func ReconcileDashboard(kubeClient *kube.KubeHTTP, namespace string, timeout time.Duration) error

ReconcileDashboard reconciles the dashboard.

func RequestReconciliation

func RequestReconciliation(ctx context.Context, kubeClient client.Client, namespacedName types.NamespacedName, gvk schema.GroupVersionKind) (string, error)

func SetupBucketSourceAndKS

func SetupBucketSourceAndKS(log logger.Logger, kubeClient *kube.KubeHTTP, namespace string, path string) error

func SyncDir

func SyncDir(log logger.Logger, dir string, bucket string, client *minio.Client) error

SyncDir recursively uploads all files in a directory to an S3 bucket with minio library

func UninstallDevBucketServer

func UninstallDevBucketServer(log logger.Logger, kubeClient *kube.KubeHTTP) error

UninstallDevBucketServer deletes the dev-bucket namespace.

func WaitForDeploymentToBeReady

func WaitForDeploymentToBeReady(log logger.Logger, kubeClient *kube.KubeHTTP, deploymentName string, namespace string) error

func WatchAndSync

func WatchAndSync(log logger.Logger, dir string, bucket string, client *minio.Client) (chan<- bool, error)

WatchAndSync watches files recursively, and re-sync the whole directory to the bucket using minio library

Types

type PortForwardSpec

type PortForwardSpec struct {
	Namespace     string
	Name          string
	Kind          string
	HostPort      string
	ContainerPort string
	Map           map[string]string
}

func ParsePortForwardSpec

func ParsePortForwardSpec(spec string) (*PortForwardSpec, error)

parse port forward specin the key-value format of "port=8000:8080,resource=svc/app,namespace=default"

Jump to

Keyboard shortcuts

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