Documentation ¶
Index ¶
- type Daemon
- func (d *Daemon) Export(ctx context.Context) ([]byte, error)
- func (d *Daemon) GitPollLoop(stop chan struct{}, wg *sync.WaitGroup, logger log.Logger)
- func (d *Daemon) GitRepoConfig(ctx context.Context, regenerate bool) (flux.GitConfig, error)
- func (d *Daemon) JobStatus(ctx context.Context, jobID job.ID) (job.Status, error)
- func (d *Daemon) ListImages(ctx context.Context, spec update.ResourceSpec) ([]flux.ImageStatus, error)
- func (d *Daemon) ListServices(ctx context.Context, namespace string) ([]flux.ControllerStatus, error)
- func (d *Daemon) LogEvent(ev event.Event) error
- func (d *Daemon) NotifyChange(ctx context.Context, change remote.Change) error
- func (d *Daemon) Ping(ctx context.Context) error
- func (d *Daemon) SyncStatus(ctx context.Context, commitRef string) ([]string, error)
- func (d *Daemon) UpdateManifests(ctx context.Context, spec update.Spec) (job.ID, error)
- func (d *Daemon) Version(ctx context.Context) (string, error)
- type DaemonJobFunc
- type LoopVars
- type NotReadyDaemon
- func (nrd *NotReadyDaemon) Export(ctx context.Context) ([]byte, error)
- func (nrd *NotReadyDaemon) GitRepoConfig(ctx context.Context, regenerate bool) (flux.GitConfig, error)
- func (nrd *NotReadyDaemon) JobStatus(context.Context, job.ID) (job.Status, error)
- func (nrd *NotReadyDaemon) ListImages(context.Context, update.ResourceSpec) ([]flux.ImageStatus, error)
- func (nrd *NotReadyDaemon) ListServices(ctx context.Context, namespace string) ([]flux.ControllerStatus, error)
- func (nrd *NotReadyDaemon) NotifyChange(context.Context, remote.Change) error
- func (nrd *NotReadyDaemon) Ping(ctx context.Context) error
- func (nrd *NotReadyDaemon) Reason() error
- func (nrd *NotReadyDaemon) SyncStatus(context.Context, string) ([]string, error)
- func (nrd *NotReadyDaemon) UpdateManifests(context.Context, update.Spec) (job.ID, error)
- func (nrd *NotReadyDaemon) UpdateStatus(status flux.GitRepoStatus, reason error)
- func (nrd *NotReadyDaemon) Version(ctx context.Context) (string, error)
- type Ref
- func (pr *Ref) Export(ctx context.Context) ([]byte, error)
- func (pr *Ref) GitRepoConfig(ctx context.Context, regenerate bool) (flux.GitConfig, error)
- func (pr *Ref) JobStatus(ctx context.Context, id job.ID) (job.Status, error)
- func (pr *Ref) ListImages(ctx context.Context, spec update.ResourceSpec) ([]flux.ImageStatus, error)
- func (pr *Ref) ListServices(ctx context.Context, namespace string) ([]flux.ControllerStatus, error)
- func (pr *Ref) NotifyChange(ctx context.Context, change remote.Change) error
- func (pr *Ref) Ping(ctx context.Context) error
- func (pr *Ref) Platform() remote.Platform
- func (pr *Ref) SyncStatus(ctx context.Context, ref string) ([]string, error)
- func (pr *Ref) UpdateManifests(ctx context.Context, spec update.Spec) (job.ID, error)
- func (pr *Ref) UpdatePlatform(platform remote.Platform)
- func (pr *Ref) Version(ctx context.Context) (string, error)
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 cluster.Manifests Registry registry.Registry ImageRefresh chan image.Name Repo git.Repo Checkout *git.Checkout Jobs *job.Queue JobStatusCache *job.StatusCache EventWriter event.EventWriter Logger log.Logger // bookkeeping *LoopVars }
Daemon is the fully-functional state of a daemon (compare to `NotReadyDaemon`).
func (*Daemon) GitPollLoop ¶
func (*Daemon) GitRepoConfig ¶
func (*Daemon) JobStatus ¶
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) ([]flux.ImageStatus, error)
List the images available for set of services
func (*Daemon) ListServices ¶
func (*Daemon) NotifyChange ¶
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) SyncStatus ¶
Ask the daemon how far it's got applying things; in particular, is it past the supplied release? Return the list of commits between where we have applied 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 _past_ it, you'll get an empty list.
func (*Daemon) UpdateManifests ¶
Apply the desired changes to the config files
type DaemonJobFunc ¶
type DaemonJobFunc func(ctx context.Context, jobID job.ID, working *git.Checkout, logger log.Logger) (*event.CommitEventMetadata, error)
Let's use the CommitEventMetadata as a convenient transport for the results of a job; if no commit was made (e.g., if it was a dry run), leave the revision field empty.
type LoopVars ¶
type LoopVars struct { GitPollInterval time.Duration RegistryPollInterval time.Duration // contains filtered or unexported fields }
func (*LoopVars) AskForImagePoll ¶
func (d *LoopVars) AskForImagePoll()
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 NotReadyDaemon ¶
NotReadyDaemon is a stub implementation used to serve a subset of the API when we have yet to successfully clone the config repo.
func NewNotReadyDaemon ¶
func NewNotReadyDaemon(version string, cluster cluster.Cluster, gitRemote flux.GitRemoteConfig) (nrd *NotReadyDaemon)
NotReadyDaemon is a state of the daemon that has not proceeded past getting the git repo set up. Since this typically needs some actions on the part of the user, this state can last indefinitely; so, it has its own code.
func (*NotReadyDaemon) Export ¶
func (nrd *NotReadyDaemon) Export(ctx context.Context) ([]byte, error)
func (*NotReadyDaemon) GitRepoConfig ¶
func (*NotReadyDaemon) ListImages ¶
func (nrd *NotReadyDaemon) ListImages(context.Context, update.ResourceSpec) ([]flux.ImageStatus, error)
func (*NotReadyDaemon) ListServices ¶
func (nrd *NotReadyDaemon) ListServices(ctx context.Context, namespace string) ([]flux.ControllerStatus, error)
func (*NotReadyDaemon) NotifyChange ¶
func (*NotReadyDaemon) Reason ¶
func (nrd *NotReadyDaemon) Reason() error
func (*NotReadyDaemon) SyncStatus ¶
func (*NotReadyDaemon) UpdateManifests ¶
func (*NotReadyDaemon) UpdateStatus ¶
func (nrd *NotReadyDaemon) UpdateStatus(status flux.GitRepoStatus, reason error)
type Ref ¶
Ref is a cell containing a platform implementation, that we can update atomically. The point of this is to be able to have a platform in use (e.g., answering RPCs), and swap it later when the state changes.
func (*Ref) GitRepoConfig ¶
func (*Ref) ListImages ¶
func (pr *Ref) ListImages(ctx context.Context, spec update.ResourceSpec) ([]flux.ImageStatus, error)