-
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.
Introduce a new Scheduled state for operations
The motivation is to be able to register a custom version of a built-in workflow. The mappers still create commands in the Init state, but the built-in operations only react on the Schedule state. If no custom version of the workflow has been provided, the agent moves operation requests from the Init to the Scheduled state. If a custom version is provided, then this user-defined workflow can add extra checks and steps before triggering the built-in operation steps (by putting the operation in the Schedule state). As of now, the log and config operation are unchanged (starting on Init and ignoring the Schedule state). Signed-off-by: Didier Wenzek <[email protected]>
- Loading branch information
1 parent
4bc4e92
commit 9b8a18f
Showing
12 changed files
with
89 additions
and
33 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
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
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
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
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
4 changes: 4 additions & 0 deletions
4
tests/RobotFramework/tests/tedge_agent/workflows/init-software-list.sh
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
echo new software list request >>/tmp/operations.log | ||
echo '{ "status":"scheduled" }' |
19 changes: 19 additions & 0 deletions
19
tests/RobotFramework/tests/tedge_agent/workflows/software_list.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
operation = "software_list" # A built in operation can be overridden | ||
|
||
[init] | ||
script = "/etc/tedge/operations/init-software-list.sh" # The json output of the script is used for the next step | ||
next = ["scheduled"] | ||
|
||
[scheduled] | ||
owner = "tedge" # Builtin behavior | ||
next = ["executing"] | ||
|
||
[executing] | ||
owner = "tedge" # Builtin behavior | ||
next = ["successful", "failed"] | ||
|
||
[successful] | ||
next = [] | ||
|
||
[failed] | ||
next = [] |