Merge pull request #115437 from bobbypage/115219-followup

test: Update runtime class detection logic
This commit is contained in:
Kubernetes Prow Robot 2023-01-31 17:05:19 -08:00 committed by GitHub
commit 046595f11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,13 +69,15 @@ func NodeSupportsPreconfiguredRuntimeClassHandler(ctx context.Context, f *framew
// If the `runtimes.test-handler` substring is found in the runtime config, it is assumed that the handler is configured.
cmd := fmt.Sprintf(`if [ -e '/etc/containerd/config.toml' ]; then
grep -q 'runtimes.%s' /etc/containerd/config.toml
return
exit
fi
if [ -e '/etc/crio/crio.conf' ]; then
grep -q 'runtimes.%s' /etc/crio/crio.conf
return
exit
fi
exit 1
`, PreconfiguredRuntimeClassHandler, PreconfiguredRuntimeClassHandler)
_, err = hostExec.IssueCommandWithResult(ctx, cmd, node)