You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`validate <type>`: Validate if the applied configuration is successful
77
+
-`rollback <type> --old-meta <json-output-from-prepare>`: Rollback the applied configuration if it failed in the `validate` phase.
78
+
-`commit <type> --old-meta <json-output-from-prepare>`: Perform any post-update steps if the `validate` phase succeeded like deleting the backed up configs.
79
+
- File-based config types can still be defined in the existing `tedge-config-plugin.toml` file.
80
+
If a corresponding plugin script is not defined for the same type,
81
+
the existing behavior of just updating the file on the fie system is maintained,
82
+
without any `prepare`, `validate`, `commit` or `rollback` phases.
83
+
- The `config-plugins` also has a `conf.d` sub-directory where extensions of the main config file can be created dynamically.
84
+
Each extension config can have entries as follows:
85
+
```
86
+
[[files]]
87
+
type = "collectd"
88
+
path = "/etc/collectd/collectd.conf"
89
+
90
+
[[files]]
91
+
type = "nginx"
92
+
path = "/etc/nginx/nginx.conf"
93
+
```
94
+
- The supported config types are gathered from the main plugin config, its extension files
95
+
and the names of all the plugins defined under `/etc/tedge/config-plugins`.
96
+
97
+
### Phase 2
98
+
99
+
Instead of the `exeucting` phase of `config_update` workflow doing everything in that single step,
100
+
break it down into multiple smaller stages that corresponds to each plugin command/phase as well as follows:
101
+
102
+
```config_update.toml
103
+
operation = "config_update"
104
+
105
+
[init]
106
+
action = "proceed"
107
+
on_success = "scheduled"
108
+
109
+
[scheduled]
110
+
action = "proceed"
111
+
on_success = "executing"
112
+
113
+
[executing]
114
+
action = "builtin:config_update:executing"
115
+
on_success = "download"
116
+
117
+
[download]
118
+
action = "builtin:config_update:executing"
119
+
on_success = "prepare"
120
+
121
+
[prepare]
122
+
action = "builtin:config_update:prepare"
123
+
on_success = "apply"
124
+
125
+
[apply]
126
+
action = "builtin:config_update:apply"
127
+
on_success = "validate"
128
+
129
+
[apply]
130
+
action = "builtin:config_update:apply"
131
+
on_success = "commit"
132
+
on_error = "rollback"
133
+
134
+
[apply]
135
+
action = "builtin:config_update:apply"
136
+
on_success = "successful"
137
+
138
+
[rollback]
139
+
action = "builtin:config_update:rollback"
140
+
on_success = "failed"
141
+
142
+
[successful]
143
+
action = "cleanup"
144
+
145
+
[failed]
146
+
action = "cleanup"
147
+
```
148
+
149
+
This helps customers override a single stage like `download` to do it their way,
150
+
while still reusing the rest of the functionality as-is.
0 commit comments