sync

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

Variables

This section is empty.

Functions

func Sync

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

Sync synchronises the cluster to the files under a directory.

Types

type GitTagSyncProvider

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

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

NewGitTagSyncProvider creates a new git tag sync provider.

func (GitTagSyncProvider) DeleteMarker

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

DeleteMarker removes the Git Tag used for syncing.

func (GitTagSyncProvider) GetRevision

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

func (p GitTagSyncProvider) String() string

func (GitTagSyncProvider) UpdateMarker

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

UpdateMarker moves the sync tag in the upstream repo.

type NativeSyncProvider

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

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

NewNativeSyncProvider creates a new NativeSyncProvider

func (NativeSyncProvider) DeleteMarker

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

DeleteMarker resets the state of the object.

func (NativeSyncProvider) GetRevision

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

func (p NativeSyncProvider) String() string

func (NativeSyncProvider) UpdateMarker

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

UpdateMarker updates the revision the sync marker points to.

type State

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

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

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

Jump to

Keyboard shortcuts

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