flux: github.com/weaveworks/flux/pkg/daemon Index | Files

package daemon

import "github.com/weaveworks/flux/pkg/daemon"

Index

Package Files

daemon.go errors.go images.go loop.go metrics.go note.go sync.go

type Daemon Uses

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 Uses

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

func (*Daemon) GitRepoConfig Uses

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

func (*Daemon) JobStatus Uses

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 Uses

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 Uses

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 Uses

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

func (*Daemon) ListServicesWithOptions Uses

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

func (*Daemon) LogEvent Uses

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

func (*Daemon) Loop Uses

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

func (*Daemon) NotifyChange Uses

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 Uses

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

func (*Daemon) Sync Uses

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 Uses

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 Uses

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

Apply the desired changes to the config files

func (*Daemon) Version Uses

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

func (*Daemon) WithReadonlyClone Uses

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 Uses

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 Uses

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 Uses

func (d *LoopVars) AskForAutomatedWorkloadImageUpdates()

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

func (*LoopVars) AskForSync Uses

func (d *LoopVars) AskForSync()

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

type SyncErrors Uses

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

Package daemon imports 33 packages (graph). Updated 2020-10-19. Refresh now. Tools for package owners.