bootstrap

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BranchOptionKey         = "branch"
	HostnameOptionKey       = "hostname"
	OwnerOptionKey          = "owner"
	PasswordOptionKey       = "password"
	PersonalOptionKey       = "personal"
	PrivateKeyFileOptionKey = "private-key-file"
	PrivateOptionKey        = "private"
	RepositoryOptionKey     = "repository"
	PATOptionKey            = "pat"
	URLOptionKey            = "url"
	UsernameOptionKey       = "username"
)

Variables

This section is empty.

Functions

func GetHost added in v0.10.0

func GetHost(repo *gogit.Repository) string

func GetURLParts

func GetURLParts(remoteURL string) parts

GetURLParts splits URL to URL parts. This takes inspiration from https://github.com/fluxcd/go-git-providers/blob/cda93bf5a5fa65bd994a60d6d3ef9ad119cfb684/gitprovider/repositoryref.go#L309 except it has to do it in reverse

func ParseGitRemote

func ParseGitRemote(log logger.Logger, workingDir string) (*gogit.Repository, error)

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

ParseRemoteURL extracts remote URL from the repository

Types

type Bootstrap added in v0.10.0

type Bootstrap interface {
	RunBootstrapCmd(context.Context, *fluxexec.Flux) error
	SyncResources(context.Context, logger.Logger, []gitprovider.CommitFile) error
}

func NewBootstrap added in v0.10.0

func NewBootstrap(clusterPath string, options BootstrapCmdOptions, provider GitProvider) Bootstrap

type BootstrapCmdOptions added in v0.10.0

type BootstrapCmdOptions map[string]string

type BootstrapCommon added in v0.10.0

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

type BootstrapForge added in v0.10.0

type BootstrapForge struct {
	BootstrapCommon
	// contains filtered or unexported fields
}

func (*BootstrapForge) RunBootstrapCmd added in v0.10.0

func (b *BootstrapForge) RunBootstrapCmd(ctx context.Context, flux *fluxexec.Flux) error

func (*BootstrapForge) SyncResources added in v0.10.0

func (b *BootstrapForge) SyncResources(ctx context.Context, log logger.Logger, commitFiles []gitprovider.CommitFile) error

type BootstrapRaw added in v0.10.0

type BootstrapRaw struct {
	BootstrapCommon
	// contains filtered or unexported fields
}

TODO: this needs to be implemented using plain go-git

func (*BootstrapRaw) RunBootstrapCmd added in v0.10.0

func (b *BootstrapRaw) RunBootstrapCmd(ctx context.Context, flux *fluxexec.Flux) error

func (*BootstrapRaw) SyncResources added in v0.10.0

func (b *BootstrapRaw) SyncResources(ctx context.Context, log logger.Logger, commitFiles []gitprovider.CommitFile) error

type BootstrapWizard

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

func NewBootstrapWizard

func NewBootstrapWizard(log logger.Logger, gitProvider GitProvider, repo *gogit.Repository) (*BootstrapWizard, error)

NewBootstrapWizard creates a wizard to gather all bootstrap config options before running flux bootstrap.

func (*BootstrapWizard) BuildCmd

func (wizard *BootstrapWizard) BuildCmd(log logger.Logger) BootstrapWizardCmd

BuildCmd builds flux bootstrap command options as key/values pairs.

func (*BootstrapWizard) Run

func (wizard *BootstrapWizard) Run(log logger.Logger) error

Run displays text inputs to enter or edit all command flag values.

type BootstrapWizardCmd

type BootstrapWizardCmd struct {
	Provider GitProvider
	Options  BootstrapCmdOptions
}

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.

Jump to

Keyboard shortcuts

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