Documentation
¶
Index ¶
- Variables
- func LoadEntityListFromPath(path string) (openpgp.EntityList, error)
- func Run(ctx context.Context, reconciler Reconciler, manifestsBase string, ...) error
- func SelectOpenPGPSigningEntity(keyRing openpgp.EntityList, passphrase, keyID string) (*openpgp.Entity, error)
- type GitOption
- type GitProviderBootstrapper
- type GitProviderOption
- func WithBootstrapTransportType(protocol string) GitProviderOption
- func WithDeployTokenAuth() GitProviderOption
- func WithProviderRepository(owner, repositoryName string, personal bool) GitProviderOption
- func WithProviderRepositoryConfig(description, defaultBranch, visibility string) GitProviderOption
- func WithProviderTeamPermissions(teams map[string]string) GitProviderOption
- func WithProviderVisibility(visibility string) GitProviderOption
- func WithReadWriteKeyPermissions(b bool) GitProviderOption
- func WithReconcile() GitProviderOption
- func WithSSHHostname(hostname string) GitProviderOption
- func WithSyncTransportType(protocol string) GitProviderOption
- type Option
- func WithBranch(branch string) Option
- func WithCommitMessageAppendix(appendix string) Option
- func WithGitCommitSigning(gpgKeyRing openpgp.EntityList, passphrase, keyID string) Option
- func WithKubeconfig(rcg genericclioptions.RESTClientGetter, opts *runclient.Options) Option
- func WithLogger(logger log.Logger) Option
- func WithSSHCommitSigning(pem, password []byte) Option
- func WithSignature(name, email string) Option
- type PlainGitBootstrapper
- func (b *PlainGitBootstrapper) ReconcileComponents(ctx context.Context, manifestsBase string, options install.Options, ...) error
- func (b *PlainGitBootstrapper) ReconcileSourceSecret(ctx context.Context, options sourcesecret.Options) error
- func (b *PlainGitBootstrapper) ReconcileSyncConfig(ctx context.Context, options sync.Options) error
- func (b *PlainGitBootstrapper) ReportComponentsHealth(ctx context.Context, install install.Options, timeout time.Duration) error
- func (b *PlainGitBootstrapper) ReportGitRepoHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error
- func (b *PlainGitBootstrapper) ReportKustomizationHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error
- type PostGenerateSecretFunc
- type Reconciler
- type ReconcilerWithSyncCheck
- type RepositoryReconciler
Constants ¶
This section is empty.
Variables ¶
var (
ErrReconciledWithWarning = errors.New("reconciled with warning")
)
Functions ¶
func LoadEntityListFromPath ¶
func LoadEntityListFromPath(path string) (openpgp.EntityList, error)
func SelectOpenPGPSigningEntity ¶ added in v2.9.0
func SelectOpenPGPSigningEntity(keyRing openpgp.EntityList, passphrase, keyID string) (*openpgp.Entity, error)
SelectOpenPGPSigningEntity selects a single OpenPGP entity from the given keyring and decrypts its private key with the provided passphrase. When keyID is empty the keyring must contain exactly one entity; otherwise the entity with the matching 16-character key ID is selected. Returns an error if no matching entity is found, the matching entity has no private key, or decryption fails.
Types ¶
type GitOption ¶
type GitOption interface {
// contains filtered or unexported methods
}
func WithPostGenerateSecretFunc ¶
func WithPostGenerateSecretFunc(callback PostGenerateSecretFunc) GitOption
func WithRepositoryURL ¶
type GitProviderBootstrapper ¶
type GitProviderBootstrapper struct {
*PlainGitBootstrapper
// contains filtered or unexported fields
}
func NewGitProviderBootstrapper ¶
func NewGitProviderBootstrapper(git repository.Client, 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) ReconcileSourceSecret ¶
func (b *GitProviderBootstrapper) ReconcileSourceSecret(ctx context.Context, options sourcesecret.Options) error
func (*GitProviderBootstrapper) ReconcileSyncConfig ¶
type GitProviderOption ¶
type GitProviderOption interface {
// contains filtered or unexported methods
}
func WithBootstrapTransportType ¶
func WithBootstrapTransportType(protocol string) GitProviderOption
func WithDeployTokenAuth ¶
func WithDeployTokenAuth() 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 WithProviderVisibility ¶ added in v2.4.0
func WithProviderVisibility(visibility string) GitProviderOption
func WithReadWriteKeyPermissions ¶
func WithReadWriteKeyPermissions(b bool) GitProviderOption
func WithReconcile ¶
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 WithBranch ¶
func WithGitCommitSigning ¶
func WithGitCommitSigning(gpgKeyRing openpgp.EntityList, passphrase, keyID string) Option
func WithKubeconfig ¶
func WithKubeconfig(rcg genericclioptions.RESTClientGetter, opts *runclient.Options) Option
func WithLogger ¶
func WithSSHCommitSigning ¶ added in v2.9.0
WithSSHCommitSigning configures the bootstrapper to sign commits with an SSH private key. pem is the PEM-encoded private key (typically the OpenSSH "-----BEGIN OPENSSH PRIVATE KEY-----" format produced by ssh-keygen). password is the optional passphrase for the key; pass nil for an unencrypted key.
WithSSHCommitSigning and WithGitCommitSigning are mutually exclusive; calling both is undefined behavior. The caller is responsible for rejecting that combination before constructing the bootstrapper (the flux CLI does this in bootstrapValidate).
func WithSignature ¶
type PlainGitBootstrapper ¶
type PlainGitBootstrapper struct {
// contains filtered or unexported fields
}
func NewPlainGitProvider ¶
func NewPlainGitProvider(git repository.Client, kube client.Client, opts ...GitOption) (*PlainGitBootstrapper, error)
func (*PlainGitBootstrapper) ReconcileComponents ¶
func (b *PlainGitBootstrapper) ReconcileComponents(ctx context.Context, manifestsBase string, options install.Options, _ sourcesecret.Options) error
func (*PlainGitBootstrapper) ReconcileSourceSecret ¶
func (b *PlainGitBootstrapper) ReconcileSourceSecret(ctx context.Context, options sourcesecret.Options) error
func (*PlainGitBootstrapper) ReconcileSyncConfig ¶
func (*PlainGitBootstrapper) ReportComponentsHealth ¶
func (*PlainGitBootstrapper) ReportGitRepoHealth ¶ added in v2.2.0
func (*PlainGitBootstrapper) ReportKustomizationHealth ¶
type PostGenerateSecretFunc ¶
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
}
Reconciler reconciles and reports the health of different components and kubernetes resources involved in the installation of Flux.
It is recommended use the `ReconcilerWithSyncCheck` interface that also reports the health of the GitRepository.
type ReconcilerWithSyncCheck ¶ added in v2.2.0
type ReconcilerWithSyncCheck interface {
Reconciler
// ReportGitRepoHealth reports about the health of the GitRepository synchronizing the components.
ReportGitRepoHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error
}
ReconcilerWithSyncCheck extends the Reconciler interface to also report the health of the GitReposiotry that syncs Flux on the cluster