-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Watch Program and Flux sources and run a Stack when they change (#348)
* Ensure Program .configuration[*].default optional The default for a configuration item is optional; but the type is (via an alias) apiextensionsv1.JSON, which is a struct. The zero value serialises to `null`, which makes the Pulumi YAML engine balk. Making this pointer typed means if it's absent, it'll be left out of the serialisation, and Pulumi YAML won't disagree with it. * React to Program objects changing At present the controller will notice changes to a Program object when it reruns a Stack that refers to that object, either because it failed the previous time, or because it requeued it on a schedule. This adds an index keeping track of which Stacks reference which Programs, and a watch that will requeue all the Stacks referring to a Program when that program changes. * Watch Flux source kinds when they are seen in sources A Stack can refer to a Flux source by (arbitrary) API version, kind, and name. This gives forward-compatibility with new and third-party sources -- but it makes it a bit trickier to detect when they have changed, because the kinds to watch aren't known until they're seen by the controller. The scheme to do so here is: 1. index the Stack against the type {group, version, kind} and name of the source they reference. This lets us look up the referencing stacks, when we see a source has been updated. 2. whenever a source is successfully retrieved (during Stack reconciliation), ensure that its kind is being watched; 3. the watchers installed in 2.) use the index in 1.) to look up the stacks using a source by type and name; then enqueue any such stacks to be reconciled. * Let the watches deal with missing sources When a flux Source is missing, we can now wait for the watch to fire when it appears, rather than retrying. The same is true when the source is marked as unready. Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
- Loading branch information
Showing
8 changed files
with
271 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.