bootstrap

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReconciledWithWarning = errors.New("reconciled with warning")
)

Functions

func Run

func Run(ctx context.Context, reconciler Reconciler, manifestsBase string,
	installOpts install.Options, secretOpts sourcesecret.Options, syncOpts sync.Options,
	pollInterval, timeout time.Duration) error

Types

type GitOption

type GitOption interface {
	// contains filtered or unexported methods
}

func WithPostGenerateSecretFunc

func WithPostGenerateSecretFunc(callback PostGenerateSecretFunc) GitOption

func WithRepositoryURL

func WithRepositoryURL(url string) GitOption

type GitProviderBootstrapper

type GitProviderBootstrapper struct {
	*PlainGitBootstrapper
	// contains filtered or unexported fields
}

func NewGitProviderBootstrapper

func NewGitProviderBootstrapper(git git.Git, provider gitprovider.Client, kube client.Client, opts ...GitProviderOption) (*GitProviderBootstrapper, error)

func (*GitProviderBootstrapper) ReconcileRepository

func (b *GitProviderBootstrapper) ReconcileRepository(ctx context.Context) error

ReconcileRepository reconciles an organization or user repository with the GitProviderBootstrapper configuration. On success, the URL in the embedded PlainGitBootstrapper is set to clone URL for the configured protocol.

When part of the reconciliation fails with a warning without aborting, an ErrReconciledWithWarning error is returned.

func (*GitProviderBootstrapper) ReconcileSyncConfig

func (b *GitProviderBootstrapper) ReconcileSyncConfig(ctx context.Context, options sync.Options) error

type GitProviderOption

type GitProviderOption interface {
	// contains filtered or unexported methods
}

func WithBootstrapTransportType

func WithBootstrapTransportType(protocol string) GitProviderOption

func WithProviderRepository

func WithProviderRepository(owner, repositoryName string, personal bool) GitProviderOption

func WithProviderRepositoryConfig

func WithProviderRepositoryConfig(description, defaultBranch, visibility string) GitProviderOption

func WithProviderTeamPermissions

func WithProviderTeamPermissions(teams map[string]string) GitProviderOption

func WithReadWriteKeyPermissions

func WithReadWriteKeyPermissions(b bool) GitProviderOption

func WithReconcile added in v0.12.3

func WithReconcile() GitProviderOption

func WithSSHHostname

func WithSSHHostname(hostname string) GitProviderOption

func WithSyncTransportType

func WithSyncTransportType(protocol string) GitProviderOption

type Option

type Option interface {
	GitOption
	GitProviderOption
}

func WithAuthor

func WithAuthor(name, email string) Option

func WithBranch

func WithBranch(branch string) Option

func WithCABundle added in v0.17.1

func WithCABundle(b []byte) Option

func WithCommitMessageAppendix

func WithCommitMessageAppendix(appendix string) Option

func WithGitCommitSigning added in v0.18.0

func WithGitCommitSigning(path, passphrase, keyID string) Option

func WithLogger

func WithLogger(logger log.Logger) Option

type PlainGitBootstrapper

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

func NewPlainGitProvider

func NewPlainGitProvider(git git.Git, kube client.Client, opts ...GitOption) (*PlainGitBootstrapper, error)

func (*PlainGitBootstrapper) ReconcileComponents

func (b *PlainGitBootstrapper) ReconcileComponents(ctx context.Context, manifestsBase string, options install.Options, secretOpts sourcesecret.Options) error

func (*PlainGitBootstrapper) ReconcileSourceSecret

func (b *PlainGitBootstrapper) ReconcileSourceSecret(ctx context.Context, options sourcesecret.Options) error

func (*PlainGitBootstrapper) ReconcileSyncConfig

func (b *PlainGitBootstrapper) ReconcileSyncConfig(ctx context.Context, options sync.Options) error

func (*PlainGitBootstrapper) ReportComponentsHealth added in v0.12.1

func (b *PlainGitBootstrapper) ReportComponentsHealth(ctx context.Context, install install.Options, timeout time.Duration) error

func (*PlainGitBootstrapper) ReportKustomizationHealth added in v0.12.1

func (b *PlainGitBootstrapper) ReportKustomizationHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error

type PostGenerateSecretFunc

type PostGenerateSecretFunc func(ctx context.Context, secret corev1.Secret, options sourcesecret.Options) error

type Reconciler

type Reconciler interface {
	// ReconcileComponents reconciles the components by generating the
	// manifests with the provided values, committing them to Git and
	// pushing to remote if there are any changes, and applying them
	// to the cluster.
	ReconcileComponents(ctx context.Context, manifestsBase string, options install.Options, secretOpts sourcesecret.Options) error

	// ReconcileSourceSecret reconciles the source secret by generating
	// a new secret with the provided values if the secret does not
	// already exists on the cluster, or if any of the configuration
	// options changed.
	ReconcileSourceSecret(ctx context.Context, options sourcesecret.Options) error

	// ReconcileSyncConfig reconciles the sync configuration by generating
	// the sync manifests with the provided values, committing them to Git
	// and pushing to remote if there are any changes.
	ReconcileSyncConfig(ctx context.Context, options sync.Options) error

	// ReportKustomizationHealth reports about the health of the
	// Kustomization synchronizing the components.
	ReportKustomizationHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error

	// ReportComponentsHealth reports about the health for the components
	// and extra components in install.Options.
	ReportComponentsHealth(ctx context.Context, options install.Options, timeout time.Duration) error
}

type RepositoryReconciler

type RepositoryReconciler interface {
	// ReconcileRepository reconciles an external Git repository.
	ReconcileRepository(ctx context.Context) error
}

Directories

Path Synopsis
git

Jump to

Keyboard shortcuts

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