Documentation ¶
Index ¶
- Variables
- func ClusterError(err error) error
- func PlatformTestBattery(t *testing.T, wrap func(mock Platform) Platform)
- func UnavailableError(err error) error
- func UnsupportedResourceKind(err error) error
- func UpgradeNeededError(err error) error
- type Change
- type ChangeKind
- type ErrorLoggingPlatform
- func (p *ErrorLoggingPlatform) Export(ctx context.Context) (config []byte, err error)
- func (p *ErrorLoggingPlatform) GitRepoConfig(ctx context.Context, regenerate bool) (_ flux.GitConfig, err error)
- func (p *ErrorLoggingPlatform) JobStatus(ctx context.Context, jobID job.ID) (_ job.Status, err error)
- func (p *ErrorLoggingPlatform) ListImages(ctx context.Context, spec update.ResourceSpec) (_ []flux.ImageStatus, err error)
- func (p *ErrorLoggingPlatform) ListServices(ctx context.Context, maybeNamespace string) (_ []flux.ControllerStatus, err error)
- func (p *ErrorLoggingPlatform) NotifyChange(ctx context.Context, change Change) (err error)
- func (p *ErrorLoggingPlatform) Ping(ctx context.Context) (err error)
- func (p *ErrorLoggingPlatform) SyncStatus(ctx context.Context, ref string) (_ []string, err error)
- func (p *ErrorLoggingPlatform) UpdateManifests(ctx context.Context, u update.Spec) (_ job.ID, err error)
- func (p *ErrorLoggingPlatform) Version(ctx context.Context) (v string, err error)
- type FatalError
- type GitUpdate
- type ImageUpdate
- type MockPlatform
- func (p *MockPlatform) Export(ctx context.Context) ([]byte, error)
- func (p *MockPlatform) GitRepoConfig(ctx context.Context, regenerate bool) (flux.GitConfig, error)
- func (p *MockPlatform) JobStatus(context.Context, job.ID) (job.Status, error)
- func (p *MockPlatform) ListImages(context.Context, update.ResourceSpec) ([]flux.ImageStatus, error)
- func (p *MockPlatform) ListServices(ctx context.Context, ns string) ([]flux.ControllerStatus, error)
- func (p *MockPlatform) NotifyChange(ctx context.Context, change Change) error
- func (p *MockPlatform) Ping(ctx context.Context) error
- func (p *MockPlatform) SyncStatus(context.Context, string) ([]string, error)
- func (p *MockPlatform) UpdateManifests(ctx context.Context, s update.Spec) (job.ID, error)
- func (p *MockPlatform) Version(ctx context.Context) (string, error)
- type Platform
- type PlatformV4
- type PlatformV5
- type PlatformV6
- type PlatformV6Deprecated
- type PlatformV6NotDeprecated
- type PlatformV9
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownChange = errors.New("unknown kind of change")
Functions ¶
func ClusterError ¶
func PlatformTestBattery ¶
func UnavailableError ¶
func UnsupportedResourceKind ¶
func UpgradeNeededError ¶
Types ¶
type Change ¶
type Change struct { Kind ChangeKind // essentially a type tag Source interface{} // what changed }
func (*Change) UnmarshalJSON ¶
type ChangeKind ¶
type ChangeKind string
const ( GitChange ChangeKind = "git" ImageChange ChangeKind = "image" )
func (ChangeKind) MarshalJSON ¶
func (k ChangeKind) MarshalJSON() ([]byte, error)
type ErrorLoggingPlatform ¶
func (*ErrorLoggingPlatform) Export ¶
func (p *ErrorLoggingPlatform) Export(ctx context.Context) (config []byte, err error)
func (*ErrorLoggingPlatform) GitRepoConfig ¶
func (*ErrorLoggingPlatform) ListImages ¶
func (p *ErrorLoggingPlatform) ListImages(ctx context.Context, spec update.ResourceSpec) (_ []flux.ImageStatus, err error)
func (*ErrorLoggingPlatform) ListServices ¶
func (p *ErrorLoggingPlatform) ListServices(ctx context.Context, maybeNamespace string) (_ []flux.ControllerStatus, err error)
func (*ErrorLoggingPlatform) NotifyChange ¶
func (p *ErrorLoggingPlatform) NotifyChange(ctx context.Context, change Change) (err error)
func (*ErrorLoggingPlatform) Ping ¶
func (p *ErrorLoggingPlatform) Ping(ctx context.Context) (err error)
func (*ErrorLoggingPlatform) SyncStatus ¶
func (*ErrorLoggingPlatform) UpdateManifests ¶
type FatalError ¶
type FatalError struct {
Err error
}
Wrap errors in this to indicate that the platform should be considered dead, and disconnected.
func (FatalError) Error ¶
func (err FatalError) Error() string
type ImageUpdate ¶
type MockPlatform ¶
type MockPlatform struct { PingError error VersionAnswer string VersionError error ExportAnswer []byte ExportError error ListServicesAnswer []flux.ControllerStatus ListServicesError error ListImagesAnswer []flux.ImageStatus ListImagesError error UpdateManifestsArgTest func(update.Spec) error UpdateManifestsAnswer job.ID UpdateManifestsError error NotifyChangeError error SyncStatusAnswer []string SyncStatusError error JobStatusAnswer job.Status JobStatusError error GitRepoConfigAnswer flux.GitConfig GitRepoConfigError error }
func (*MockPlatform) GitRepoConfig ¶
func (*MockPlatform) ListImages ¶
func (p *MockPlatform) ListImages(context.Context, update.ResourceSpec) ([]flux.ImageStatus, error)
func (*MockPlatform) ListServices ¶
func (p *MockPlatform) ListServices(ctx context.Context, ns string) ([]flux.ControllerStatus, error)
func (*MockPlatform) NotifyChange ¶
func (p *MockPlatform) NotifyChange(ctx context.Context, change Change) error
func (*MockPlatform) SyncStatus ¶
func (*MockPlatform) UpdateManifests ¶
type Platform ¶
type Platform interface { PlatformV9 }
Platform is the SPI for the daemon; i.e., it's all the things we have to ask to the daemon, rather than the service.
func Instrument ¶
type PlatformV4 ¶
type PlatformV5 ¶
type PlatformV5 interface { PlatformV4 // We still support this, for bootstrapping; but it might // reasonably be moved to the daemon interface, or removed in // favour of letting people use their cluster-specific tooling. Export(context.Context) ([]byte, error) }
type PlatformV6 ¶
type PlatformV6 interface { PlatformV6Deprecated PlatformV6NotDeprecated }
type PlatformV6Deprecated ¶
type PlatformV6NotDeprecated ¶
type PlatformV6NotDeprecated interface { PlatformV5 // These are new, or newly moved to this interface ListServices(ctx context.Context, namespace string) ([]flux.ControllerStatus, error) ListImages(context.Context, update.ResourceSpec) ([]flux.ImageStatus, error) // Send a spec for updating config to the daemon UpdateManifests(context.Context, update.Spec) (job.ID, error) // Ask the daemon where it's up to with syncing SyncStatus(ctx context.Context, ref string) ([]string, error) // Ask the daemon where it's up to with job processing JobStatus(context.Context, job.ID) (job.Status, error) // Get the daemon's public SSH key GitRepoConfig(ctx context.Context, regenerate bool) (flux.GitConfig, error) }
In which we move functionality that refers to the Git repo or image registry into the platform. Methods that we no longer use are deprecated, so this does not include the previous definitions, though it does include some their methods.
type PlatformV9 ¶
type PlatformV9 interface { PlatformV6NotDeprecated // ChangeNotify tells the daemon that we've noticed a change in // e.g., the git repo, or image registry, and now would be a good // time to update its state. NotifyChange(context.Context, Change) error }
PlatformV9 effectively replaces the SyncNotify with the more generic ChangeNotify, so we can use it to inform the daemon of new images (or rather, a change to an image repo that is _probably_ a new image being pushed)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.