https://rancher.com/ logo
Title
f

future-night-11133

02/20/2023, 5:46 AM
While trying to use the restart policy “*unless-stopped*”, I got the following message:
FATA[0000] unsupported restart policy "unless-stopped", supported policies are: []
Doing some investigation at nerdctl code, I found this lines at checkRestartCapabilities:
res, err := client.IntrospectionService().Plugins(ctx, []string{"id==restart"})
	if err != nil {
		return false, err
	}
	if len(res.Plugins) == 0 {
		return false, fmt.Errorf("no restart plugin found")
	}
	restartPlugin := res.Plugins[0]
	capabilities := restartPlugin.Capabilities
	if len(capabilities) == 0 {
		capabilities = []string{"always"}
	}
	if !strutil.InStringSlice(capabilities, policySlice[0]) {
		return false, fmt.Errorf("unsupported restart policy %q, supported policies are: %q", policySlice[0], restartPlugin.Capabilities)
	}
It seems it could’t find the policies available from containerd so it set default to “always” only, which is the only one working here. After some research, I came across this command to list containerd plugins:
ctr plugins ls
So I tried:
❯ rdctl shell ctr plugins ls
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
Error: exit status 255
Is this a containerd problem, or rancher-desktop? Maybe because of M1 architecture. @fast-garage-66093 maybe you have a clue about it. Thanks!
P.S.: The response of:
res, err := client.IntrospectionService().Plugins(ctx, []string{"id==restart"})
Is:
"plugins:{type:\"io.containerd.internal.v1\"  id:\"restart\"  requires:\"io.containerd.event.v1\"  requires:\"io.containerd.service.v1\"}"
So it seems it acquired the response about the plugin “restart”, but the Capabilities where not returned. 🤔
f

fast-garage-66093

02/20/2023, 8:30 PM
Could you file a Github issue for this? Today is a holiday here in BC, and I already have a fully booked rest of the week, so I might not get around to it quickly. Otherwise it might just get lost here in Slack history...
f

future-night-11133

02/20/2023, 9:41 PM
Sure @fast-garage-66093, Thanks!
f

fast-garage-66093

02/20/2023, 9:48 PM
Thanks you!