Adding a new ready condition FileState - #402
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
FileState
| * **Description:** Specifies the required existence state of the file. | ||
| * **Allowed Values:** | ||
| * ``"Exists"``: The component is ready when the file at ``file_path`` exists. | ||
| * ``"Deleted"``: The component is ready when the file at ``file_path`` is deleted. |
There was a problem hiding this comment.
Are there any files which cannot be watched via inotify and thus we need to poll for their existence with some to-be-configured interval?
| * **Allowed Values:** | ||
| * ``"Running"``: The process has started and reached its running state. | ||
| * ``"Terminated"``: The process has started, reached its running state, and then terminated successfully. | ||
| * **file_state** (object, optional) |
There was a problem hiding this comment.
Is it valid to configure both process_state and file_state at the same time?
| { | ||
| ProcessState process_state{ProcessState::Running}; | ||
| std::optional<ProcessState> process_state{ProcessState::Running}; | ||
| std::optional<FileState> file_state; |
There was a problem hiding this comment.
I wonder if here or even in the user config we shall introduce some 'type' attribute that defines which type of ready condition is configured/used, or is it intended to support any combinations of these?
"readyCondition" : {
"type": "PROCESS_STATE",
....
}For now with just 2 types its probably still manageable as is.
If we introduce more ready conditions, it might get out of hand.
| // Absolute path to the file being watched. | ||
| file_path:string (required); // required | ||
| // Existence state of the file. Defaults to Exists if not specified. | ||
| state:FileExistenceState = Exists; // optional, defaults to Exists |
There was a problem hiding this comment.
Currently, all the default values are in scripts/config_mapping/lifecycle_config.py
I think this mapping is not existing in the PR
| "description": "Specifies a ready condition based on the existence state of a file at a given path.", | ||
| "properties": { | ||
| "file_path": { | ||
| "type": "string", |
There was a problem hiding this comment.
Is it possible to specify a regex here to validate the basic format of the path?
For example that it is an absolute path that starts with "/".
Adding a new ready condition for file state.
E.g. a component like "setup network" can wait for some
/dev/<network file>to make the component active. Then Later components can depend on this.