Skip to content

Commit ebcf504

Browse files
committed
fix: trigger CRI config merge on correct resource update
When registry CRI config gets updated, contents of the file are written to the `EtcFileSpec` resource, which gets rendered to disk and resource `EtcFileStatus` is updated when the config is ready. CRI config parts are merged from contents of `*.part` files which come from system extensions and dynamic registry config which is written via `EtcFileSpec` resource. As the controller was incorrectly triggered on `EtcFileSpec` resource while reading files from disk, it might have read stale contents of CRI config part (which hasn't been fully rendered to disk), it might miss the latest content of the CRI config. With the fix, controller is triggered on `EtcFileStatus` update, so when the file is rendered to disk. The symptom of the bug is the empty CRI registry config like: ```shell talosctl read /etc/cri/conf.d/cri.toml ## /etc/cri/conf.d/00-base.part version = 2 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" discard_unpacked_layers = true ## /etc/cri/conf.d/01-registries.part ``` Notice that the `01-registries.part` is empty. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com> (cherry picked from commit 7568d51)
1 parent 84c1001 commit ebcf504

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/app/machined/pkg/controllers/files/cri_config_parts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (ctrl *CRIConfigPartsController) Inputs() []controller.Input {
3636
return []controller.Input{
3737
{
3838
Namespace: files.NamespaceName,
39-
Type: files.EtcFileSpecType,
39+
Type: files.EtcFileStatusType,
4040
ID: pointer.ToString(constants.CRIRegistryConfigPart), // watch only registry configuration which might be updated
4141
Kind: controller.InputWeak,
4242
},

0 commit comments

Comments
 (0)