flux: github.com/fluxcd/flux/pkg/sync Index | Files

package sync

import "github.com/fluxcd/flux/pkg/sync"

Index

Package Files

git.go mock.go provider.go secret.go sync.go

Constants

const (
    // GitTagStateMode is a mode of state management where Flux uses a git tag for managing Flux state
    GitTagStateMode = "git"

    // NativeStateMode is a mode of state management where Flux uses native Kubernetes resources for managing Flux state
    NativeStateMode = "secret"
)
const (
    // VerifySignaturesModeDefault - get the default behavior when casting
    VerifySignaturesModeDefault = ""

    // VerifySignaturesModeNone (default) - don't verify any commits
    VerifySignaturesModeNone = "none"

    // VerifySignaturesModeAll - consider all possible commits
    VerifySignaturesModeAll = "all"

    // VerifySignaturesModeFirstParent - consider only commits on the chain of
    // first parents (i.e. don't consider commits merged from another branch)
    VerifySignaturesModeFirstParent = "first-parent"
)

func Sync Uses

func Sync(setName string, repoResources map[string]resource.Resource, clus Syncer) error

Sync synchronises the cluster to the files under a directory.

type GitTagSyncProvider Uses

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

GitTagSyncProvider is the mechanism by which a Git tag is used to keep track of the current point fluxd has synced to.

func NewGitTagSyncProvider Uses

func NewGitTagSyncProvider(
    repo *git.Repo,
    syncTag string,
    signingKey string,
    verifyTagMode VerifySignaturesMode,
    config git.Config,
) (GitTagSyncProvider, error)

NewGitTagSyncProvider creates a new git tag sync provider.

func (GitTagSyncProvider) DeleteMarker Uses

func (p GitTagSyncProvider) DeleteMarker(ctx context.Context) error

DeleteMarker removes the Git Tag used for syncing.

func (GitTagSyncProvider) GetRevision Uses

func (p GitTagSyncProvider) GetRevision(ctx context.Context) (string, error)

GetRevision returns the revision of the git commit where the flux sync tag is currently positioned.

func (GitTagSyncProvider) String Uses

func (p GitTagSyncProvider) String() string

func (GitTagSyncProvider) UpdateMarker Uses

func (p GitTagSyncProvider) UpdateMarker(ctx context.Context, revision string) error

UpdateMarker moves the sync tag in the upstream repo.

type NativeSyncProvider Uses

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

NativeSyncProvider keeps information related to the native state of a sync marker stored in a "native" kubernetes resource.

func NewNativeSyncProvider Uses

func NewNativeSyncProvider(namespace string, resourceName string) (NativeSyncProvider, error)

NewNativeSyncProvider creates a new NativeSyncProvider

func (NativeSyncProvider) DeleteMarker Uses

func (p NativeSyncProvider) DeleteMarker(ctx context.Context) error

DeleteMarker resets the state of the object.

func (NativeSyncProvider) GetRevision Uses

func (p NativeSyncProvider) GetRevision(ctx context.Context) (string, error)

GetRevision gets the revision of the current sync marker (representing the place flux has synced to).

func (NativeSyncProvider) String Uses

func (p NativeSyncProvider) String() string

func (NativeSyncProvider) UpdateMarker Uses

func (p NativeSyncProvider) UpdateMarker(ctx context.Context, revision string) error

UpdateMarker updates the revision the sync marker points to.

type State Uses

type State interface {
    // GetRevision fetches the recorded revision, returning an empty
    // string if none has been recorded yet.
    GetRevision(ctx context.Context) (string, error)
    // UpdateMarker records the high water mark
    UpdateMarker(ctx context.Context, revision string) error
    // DeleteMarker removes the high water mark
    DeleteMarker(ctx context.Context) error
    // String returns a string representation of where the state is
    // recorded (e.g., for referring to it in logs)
    String() string
}

type Syncer Uses

type Syncer interface {
    Sync(cluster.SyncSet) error
}

Syncer has the methods we need to be able to compile and run a sync

type VerifySignaturesMode Uses

type VerifySignaturesMode string

VerifySignaturesMode represents the strategy to use when choosing which commits to GPG-verify between the flux sync tag and the tip of the flux branch

func ToVerifySignaturesMode Uses

func ToVerifySignaturesMode(s string) (VerifySignaturesMode, error)

ToVerifySignaturesMode converts a string to a VerifySignaturesMode

Package sync imports 13 packages (graph) and is imported by 2 packages. Updated 2020-03-07. Refresh now. Tools for package owners.