Documentation
¶
Index ¶
- func Buttons(ctx context.Context, client client.Reader, restartOn *v1alpha1.RestartOnSpec, ...) (map[string]*v1alpha1.UIButton, error)
- func ExtractKeysForIndexer(namespace string, restartOn *v1alpha1.RestartOnSpec, ...) []indexer.Key
- func FileWatches(ctx context.Context, client client.Reader, restartOn *v1alpha1.RestartOnSpec) (map[string]*v1alpha1.FileWatch, error)
- func FilesChanged(restartOn *v1alpha1.RestartOnSpec, fileWatches map[string]*v1alpha1.FileWatch, ...) []string
- func LastRestartEvent(restartOn *v1alpha1.RestartOnSpec, restartObjs Objects) (time.Time, *v1alpha1.UIButton)
- func LastStartEvent(startOn *v1alpha1.StartOnSpec, restartObjs Objects) (time.Time, *v1alpha1.UIButton)
- type Objects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Buttons ¶
func Buttons(ctx context.Context, client client.Reader, restartOn *v1alpha1.RestartOnSpec, startOn *v1alpha1.StartOnSpec) (map[string]*v1alpha1.UIButton, error)
Fetch all the buttons that this object depends on.
If a button isn't in the API server yet, it will simply be missing from the map.
Other errors reaching the API server will be returned to the caller.
TODO(nick): If the user typos a button name, there's currently no feedback that this is happening. This is probably the correct product behavior (in particular: resources should still run if their restarton button has been deleted). We might eventually need some sort of StartOnStatus/RestartOnStatus to express errors in lookup.
func ExtractKeysForIndexer ¶ added in v0.22.15
func ExtractKeysForIndexer(namespace string, restartOn *v1alpha1.RestartOnSpec, startOn *v1alpha1.StartOnSpec) []indexer.Key
ExtractKeysForIndexer returns the keys of objects referenced in the RestartOnSpec and/or StartOnSpec.
func FileWatches ¶
func FileWatches(ctx context.Context, client client.Reader, restartOn *v1alpha1.RestartOnSpec) (map[string]*v1alpha1.FileWatch, error)
Fetch all the filewatches that this object depends on.
If a filewatch isn't in the API server yet, it will simply be missing from the map.
Other errors reaching the API server will be returned to the caller.
TODO(nick): If the user typos a filewatch name, there's currently no feedback that this is happening. This is probably the correct product behavior (in particular: resources should still run if their restarton filewatch has been deleted). We might eventually need some sort of RestartOnStatus to express errors in lookup.
func FilesChanged ¶
func FilesChanged(restartOn *v1alpha1.RestartOnSpec, fileWatches map[string]*v1alpha1.FileWatch, lastBuild time.Time) []string
Fetch the set of files that have changed since the given timestamp. We err on the side of undercounting (i.e., skipping files that may have triggered this build but are not sure).
func LastRestartEvent ¶
func LastRestartEvent(restartOn *v1alpha1.RestartOnSpec, restartObjs Objects) (time.Time, *v1alpha1.UIButton)
Fetch the last time a restart was requested from this target's dependencies.
Returns the most recent trigger time. If the most recent trigger is a button, return the button. Some consumers use the button for text inputs.
func LastStartEvent ¶
func LastStartEvent(startOn *v1alpha1.StartOnSpec, restartObjs Objects) (time.Time, *v1alpha1.UIButton)
Fetch the last time a start was requested from this target's dependencies.
Returns the most recent trigger time. If the most recent trigger is a button, return the button. Some consumers use the button for text inputs.
Types ¶
type Objects ¶ added in v0.22.15
type Objects struct { UIButtons map[string]*v1alpha1.UIButton FileWatches map[string]*v1alpha1.FileWatch }
Objects is a container for objects referenced by a RestartOnSpec and/or StartOnSpec.
func FetchObjects ¶ added in v0.22.15
func FetchObjects(ctx context.Context, client client.Reader, restartOn *v1alpha1.RestartOnSpec, startOn *v1alpha1.StartOnSpec) (Objects, error)
FetchObjects retrieves all objects referenced in either the RestartOnSpec or StartOnSpec.