-
Notifications
You must be signed in to change notification settings - Fork 31
Adding a new ready condition FileState
#402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,17 @@ component_properties (object) | |
| * **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) | ||
| * **Description:** Specifies a ready condition based on the existence state of a file at a given path. | ||
| * **Properties:** | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume we do not need a dedicated timeout here and we will use the existing ready_timeout parameter.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the same parameter shall be used, I think later this we might have the decouple this from the process and make the component care about this. |
||
| * **file_path** (string, required) | ||
| * **Description:** Specifies the absolute path to the file being watched. | ||
| * **state** (string, optional) | ||
| * **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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed only containers would be problematic here, and I think for now since we do not support containers anyways I don't think we should support this yet. I think in the future we could have an optional polling_rate var that when set would switch to using polling but don't think it makes sense to pay so much of a slow down to support a very specific scenario. |
||
| * **Default:** ``"Exists"`` | ||
|
|
||
| .. _lm_conf_deployment_config_object_: | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,6 +89,29 @@ | |
| "Terminated" | ||
| ], | ||
| "description": "Specifies the required state of the component's POSIX process. '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": { | ||
| "type": "object", | ||
| "description": "Specifies a ready condition based on the existence state of a file at a given path.", | ||
| "properties": { | ||
| "file_path": { | ||
| "type": "string", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to specify a regex here to validate the basic format of the path?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a validation |
||
| "description": "Specifies the absolute path to the file being watched." | ||
| }, | ||
| "state": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "Exists", | ||
| "Deleted" | ||
| ], | ||
| "pattern": "^/.*", | ||
| "description": "Specifies the required existence state of the file. 'Exists': the file must be present at 'file_path'. 'Deleted': the file must be absent from 'file_path'. Defaults to 'Exists' if not specified." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "file_path" | ||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": [], | ||
|
|
@@ -488,4 +511,4 @@ | |
| "initial_run_target" | ||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it valid to configure both process_state and file_state at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it now that only one ready condition can be set.