Documentation
¶
Index ¶
- Variables
- func CleanupBucketSourceAndKS(log logger.Logger, kubeClient client.Client, namespace string) error
- func CreateDashboardObjects(log logger.Logger, name string, namespace string, username string, ...) ([]byte, error)
- func CreateIgnorer(gitRootDir string) *ignore.GitIgnore
- func EnablePortForwardingForDashboard(log logger.Logger, kubeClient client.Client, config *rest.Config, ...) (func(), error)
- func FindGitRepoDir() (string, error)
- func ForwardPort(pod *corev1.Pod, cfg *rest.Config, specMap *PortForwardSpec, ...) error
- func GenerateSecret(log logger.Logger, password string) (string, error)
- func GetFluxVersion(log logger.Logger, ctx context.Context, kubeClient client.Client) (string, error)
- func GetKubeClient(log logger.Logger, contextName string, cfg *rest.Config, ...) (*kube.KubeHTTP, error)
- func GetKubeClientOptions() *runclient.Options
- func GetKubeConfigArgs() *genericclioptions.ConfigFlags
- func GetPodFromResourceDescription(namespacedName types.NamespacedName, kind string, kubeClient client.Client) (*corev1.Pod, error)
- func GetRelativePathToRootDir(rootDir string, path string) (string, error)
- func GetURLParts(remoteURL string) []string
- func InitializeTargetDir(targetPath string) error
- func InstallDashboard(log logger.Logger, ctx context.Context, manager ResourceManagerForApply, ...) error
- func InstallDevBucketServer(log logger.Logger, kubeClient client.Client, config *rest.Config) (func(), error)
- func IsDashboardInstalled(log logger.Logger, ctx context.Context, kubeClient client.Client, name string, ...) bool
- func IsLocalCluster(kubeClient *kube.KubeHTTP) bool
- func NewManager(log logger.Logger, ctx context.Context, kubeClient ctrlclient.Client, ...) (*ssa.ResourceManager, error)
- func ParseGitRemote(log logger.Logger, workingDir string) (*gogit.Repository, error)
- func ParseRemoteURL(repo *gogit.Repository) (string, error)
- func ReadPassword(log logger.Logger) (string, error)
- func ReconcileDashboard(kubeClient client.Client, name string, namespace string, podName string, ...) error
- func ReconcileDevBucketSourceAndKS(log logger.Logger, kubeClient client.Client, namespace string, ...) error
- func SetupBucketSourceAndKS(log logger.Logger, kubeClient client.Client, namespace string, path string, ...) error
- func SyncDir(log logger.Logger, dir string, bucket string, client *minio.Client, ...) error
- func UninstallDevBucketServer(log logger.Logger, kubeClient client.Client) error
- func WatchDirsForFileWalker(watcher *fsnotify.Watcher, ignorer *ignore.GitIgnore) func(path string, info os.FileInfo, err error) error
- type BootstrapWizard
- type BootstrapWizardResult
- type BootstrapWizardTask
- type DefaultValueGetter
- type GitProvider
- type PortForwardSpec
- type ResourceManagerForApply
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoPodsForService = errors.New("no pods found for service") ErrNoPodsForDeployment = errors.New("no pods found for deployment") ErrNoRunningPodsForService = errors.New("no running pods found for service") ErrNoRunningPodsForDeployment = errors.New("no running pods found for deployment") ErrDashboardPodNotFound = errors.New("dashboard pod not found") )
var (
DevBucketContainerImage = "ghcr.io/weaveworks/gitops-bucket-server@sha256:b0446a6c645b5d39cf0db558958bf28363aca3ea80dc9d593983173613a4f290"
)
Functions ¶
func CleanupBucketSourceAndKS ¶
CleanupBucketSourceAndKS removes the bucket source and ks
func CreateDashboardObjects ¶ added in v0.9.4
func CreateDashboardObjects(log logger.Logger, name string, namespace string, username string, secret string, chartVersion string) ([]byte, error)
CreateDashboardObjects creates HelmRepository and HelmRelease objects for the GitOps Dashboard installation.
func CreateIgnorer ¶ added in v0.9.5
func EnablePortForwardingForDashboard ¶
func EnablePortForwardingForDashboard(log logger.Logger, kubeClient client.Client, config *rest.Config, namespace string, podName string, dashboardPort string) (func(), error)
EnablePortForwardingForDashboard enables port forwarding for the GitOps Dashboard.
func FindGitRepoDir ¶
FindGitRepoDir finds git repo root directory
func ForwardPort ¶
func GenerateSecret ¶ added in v0.9.2
func GetFluxVersion ¶
func GetKubeClient ¶
func GetKubeClientOptions ¶
func GetKubeConfigArgs ¶
func GetKubeConfigArgs() *genericclioptions.ConfigFlags
func GetPodFromResourceDescription ¶ added in v0.9.4
func GetRelativePathToRootDir ¶
GetRelativePathToRootDir gets relative path to a directory from the git root. It returns an error if there's no git repo.
func InitializeTargetDir ¶ added in v0.9.5
func InstallDashboard ¶
func InstallDashboard(log logger.Logger, ctx context.Context, manager ResourceManagerForApply, manifests []byte) error
InstallDashboard installs the GitOps Dashboard.
func InstallDevBucketServer ¶
func InstallDevBucketServer(log logger.Logger, kubeClient client.Client, 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 IsDashboardInstalled ¶
func IsDashboardInstalled(log logger.Logger, ctx context.Context, kubeClient client.Client, name string, namespace string) bool
IsDashboardInstalled checks if the GitOps Dashboard is installed.
func IsLocalCluster ¶
IsLocalCluster checks if it's a local cluster. See https://skaffold.dev/docs/environment/local-cluster/
func NewManager ¶ added in v0.9.2
func NewManager(log logger.Logger, ctx context.Context, kubeClient ctrlclient.Client, kubeConfigArgs genericclioptions.RESTClientGetter) (*ssa.ResourceManager, error)
func ParseGitRemote ¶
ParseGitRemote parses the git remote (if it exists) from the working directory to autofill some command options.
func ParseRemoteURL ¶
func ParseRemoteURL(repo *gogit.Repository) (string, error)
ParseRemoteURL extracts remote URL from the repository
func ReconcileDashboard ¶
func ReconcileDashboard(kubeClient client.Client, name string, namespace string, podName string, timeout time.Duration) error
ReconcileDashboard reconciles the dashboard.
func ReconcileDevBucketSourceAndKS ¶ added in v0.9.2
func ReconcileDevBucketSourceAndKS(log logger.Logger, kubeClient client.Client, namespace string, timeout time.Duration) error
ReconcileDevBucketSourceAndKS reconciles the dev-bucket and dev-ks asynchronously.
func SetupBucketSourceAndKS ¶
func SyncDir ¶
func SyncDir(log logger.Logger, dir string, bucket string, client *minio.Client, ignorer *ignore.GitIgnore) error
SyncDir recursively uploads all files in a directory to an S3 bucket with minio library
func UninstallDevBucketServer ¶
UninstallDevBucketServer deletes the dev-bucket namespace.
Types ¶
type BootstrapWizard ¶
type BootstrapWizard struct {
// contains filtered or unexported fields
}
func NewBootstrapWizard ¶
func NewBootstrapWizard(log logger.Logger, remoteURL string, gitProvider GitProvider, repo *gogit.Repository, path string) (*BootstrapWizard, error)
NewBootstrapWizard creates a wizard to gather all bootstrap config options before running flux bootstrap.
func (*BootstrapWizard) BuildCommand ¶
func (wizard *BootstrapWizard) BuildCommand(log logger.Logger) string
BuildCommand builds flux bootstrap command as a text string.
type BootstrapWizardResult ¶
type BootstrapWizardResult struct {
// contains filtered or unexported fields
}
type BootstrapWizardTask ¶
type BootstrapWizardTask struct {
// contains filtered or unexported fields
}
type DefaultValueGetter ¶
type DefaultValueGetter func(*gogit.Repository) string
type GitProvider ¶
type GitProvider int32
const ( GitProviderUnknown GitProvider = 0 GitProviderGitHub GitProvider = 1 GitProviderGitLab GitProvider = 2 GitProviderGit GitProvider = 3 GitProviderBitbucketServer GitProvider = 4 )
func ParseGitProvider ¶
func ParseGitProvider(hostname string) GitProvider
ParseGitProvider extracts git provider from the remote URL, if possible
func SelectGitProvider ¶
func SelectGitProvider(log logger.Logger) (GitProvider, error)
SelectGitProvider displays text inputs to enter or edit all command flag values.
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"
type ResourceManagerForApply ¶ added in v0.9.2
type ResourceManagerForApply interface {
ApplyAll(ctx context.Context, objects []*unstructured.Unstructured, opts ssa.ApplyOptions) (*ssa.ChangeSet, error)
WaitForSet(set object.ObjMetadataSet, opts ssa.WaitOptions) error
}