daemon

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	V                         string
	Cluster                   cluster.Cluster
	Manifests                 manifests.Manifests
	Registry                  registry.Registry
	ImageRefresh              chan image.Name
	Repo                      *git.Repo
	GitConfig                 git.Config
	Jobs                      *job.Queue
	JobStatusCache            *job.StatusCache
	EventWriter               event.EventWriter
	Logger                    log.Logger
	ManifestGenerationEnabled bool
	GitSecretEnabled          bool
	// bookkeeping
	*LoopVars
}

Daemon is the fully-functional state of a daemon (compare to `NotReadyDaemon`).

func (*Daemon) Export

func (d *Daemon) Export(ctx context.Context) ([]byte, error)

func (*Daemon) GitRepoConfig

func (d *Daemon) GitRepoConfig(ctx context.Context, regenerate bool) (v6.GitConfig, error)

func (*Daemon) JobStatus

func (d *Daemon) JobStatus(ctx context.Context, jobID job.ID) (job.Status, error)

JobStatus - Ask the daemon how far it's got committing things; in particular, is the job queued? running? committed? If it is done, the commit ref is returned.

func (*Daemon) ListImages

func (d *Daemon) ListImages(ctx context.Context, spec update.ResourceSpec) ([]v6.ImageStatus, error)

ListImages - deprecated from v10, lists the images available for set of workloads

func (*Daemon) ListImagesWithOptions

func (d *Daemon) ListImagesWithOptions(ctx context.Context, opts v10.ListImagesOptions) ([]v6.ImageStatus, error)

ListImagesWithOptions lists the images available for set of workloads

func (*Daemon) ListServices

func (d *Daemon) ListServices(ctx context.Context, namespace string) ([]v6.ControllerStatus, error)

func (*Daemon) ListServicesWithOptions

func (d *Daemon) ListServicesWithOptions(ctx context.Context, opts v11.ListServicesOptions) ([]v6.ControllerStatus, error)

func (*Daemon) LogEvent

func (d *Daemon) LogEvent(ev event.Event) error

func (*Daemon) Loop

func (d *Daemon) Loop(stop chan struct{}, wg *sync.WaitGroup, logger log.Logger)

func (*Daemon) NotifyChange

func (d *Daemon) NotifyChange(ctx context.Context, change v9.Change) error

Tell the daemon to synchronise the cluster with the manifests in the git repo. This has an error return value because upstream there may be comms difficulties or other sources of problems; here, we always succeed because it's just bookkeeping.

func (*Daemon) Ping

func (d *Daemon) Ping(ctx context.Context) error

func (*Daemon) Sync

func (d *Daemon) Sync(ctx context.Context, started time.Time, newRevision string, rat ratchet) error

Sync starts the synchronization of the cluster with git.

func (*Daemon) SyncStatus

func (d *Daemon) SyncStatus(ctx context.Context, commitRef string) ([]string, error)

Ask the daemon how far it's got applying things; in particular, is it past the given commit? Return the list of commits between where we have applied (the sync tag) and the ref given, inclusive. E.g., if you send HEAD, you'll get all the commits yet to be applied. If you send a hash and it's applied at or _past_ it, you'll get an empty list.

func (*Daemon) UpdateManifests

func (d *Daemon) UpdateManifests(ctx context.Context, spec update.Spec) (job.ID, error)

Apply the desired changes to the config files

func (*Daemon) Version

func (d *Daemon) Version(ctx context.Context) (string, error)

func (*Daemon) WithReadonlyClone

func (d *Daemon) WithReadonlyClone(ctx context.Context, fn func(*git.Export) error) error

WithReadonlyClone applies the given func to an export of the current revision of the git repo. Use this if you just need to consult the files.

func (*Daemon) WithWorkingClone

func (d *Daemon) WithWorkingClone(ctx context.Context, fn func(*git.Checkout) error) error

WithWorkingClone applies the given func to a fresh, writable clone of the git repo, and cleans it up afterwards. This may return an error in the case that the repo is read-only; use `WithReadonlyClone` if you only need to read the files in the git repo.

type LoopVars

type LoopVars struct {
	SyncInterval            time.Duration
	SyncTimeout             time.Duration
	AutomationInterval      time.Duration
	GitTimeout              time.Duration
	GitVerifySignaturesMode fluxsync.VerifySignaturesMode
	SyncState               fluxsync.State
	ImageScanDisabled       bool
	// contains filtered or unexported fields
}

func (*LoopVars) AskForAutomatedWorkloadImageUpdates

func (d *LoopVars) AskForAutomatedWorkloadImageUpdates()

Ask for an image poll, or if there's one waiting, let that happen.

func (*LoopVars) AskForSync

func (d *LoopVars) AskForSync()

Ask for a sync, or if there's one waiting, let that happen.

type SyncErrors

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

Jump to

Keyboard shortcuts

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