spegel icon indicating copy to clipboard operation
spegel copied to clipboard

Containerd hosts config are sorted and not in the specified order

Open vflaux opened this issue 6 months ago • 3 comments

Spegel version

v0.0.23

Kubernetes distribution

na

Kubernetes version

na

CNI

na

Describe the bug

The order of hosts in the hosts.toml files in containerd config generated by the spegel configuration command do not preserve the order of previous config nor the order in arguments. This is due to the fact that maps marshalled with the go-toml library are sorted by key. The issue is that the order of the "hosts" table is important in containerd as hosts are tried in order of apparition in the file.

All current tests pass because it seems they take this fact into account. You can try to switch the order of mirrors in input of a test without changing the expected output. The test will still pass while it shouldn't.

vflaux avatar Jul 29 '24 15:07 vflaux