func WithWaitUntilSystemdReachesMultiUserSystem() RunContainerOpt {
	re, err := regexp.Compile("Reached target .*Multi-User System.*|detected cgroup v1")
	if err != nil {
		panic(err)
	}
	return WithWaitUntilLogRegexpMatches(re)
}
// WithWaitUntilSystemdReachesMultiUserSystem waits until the systemd in the container
// reaches "Multi-User System" target if is using cgroups v2, so that `docker exec` can be
// executed safely without breaking cgroup v2 hierarchy.
//
// This is implemented by grepping `docker logs` with "Reached target .*Multi-User System.*"
// message from systemd.
// (we can't use `docker exec` to check whether we are allowed to run `docker exec`, obviously.)
//
// Needed for avoiding "ERROR: this script needs /sys/fs/cgroup/cgroup.procs to be empty (for writing the top-level cgroup.subtree_control)"
// See https://github.com/kubernetes-sigs/kind/issues/2409
WithWaitUntilSystemdReachesMultiUserSystem waits until the systemd in the container
reaches "Multi-User System" target if is using cgroups v2, so that `docker exec` can be
executed safely without breaking cgroup v2 hierarchy.

This is implemented by grepping `docker logs` with "Reached target .*Multi-User System.*"
message from systemd.
(we can't use `docker exec` to check whether we are allowed to run `docker exec`, obviously.)


// WithWaitUntilSystemdReachesMultiUserSystem waits until the systemd in the container // reaches " Multi - User System " target if is using cgroups v2 so that ` docker exec ` can be // executed safely without breaking cgroup v2 hierarchy . // // This is implemented by grepping ` docker logs ` with " Reached target . * Multi - User System . * " // message from systemd . // ( we can ' t use ` docker exec ` to check whether we are allowed to run ` docker exec ` obviously . ) // // Needed for avoiding " ERROR : this script needs / sys / fs / cgroup / cgroup . procs to be empty ( for writing the top - level cgroup . subtree_control ) " // See https : // github . com / kubernetes - sigs / kind / issues / 2409
func WithWaitUntilSystemdReachesMultiUserSystem() RunContainerOpt {
	re, err := regexp.Compile("Reached target .*Multi-User System.*|detected cgroup v1")
	if err != nil {
		panic(err)
	}
	return WithWaitUntilLogRegexpMatches(re)
}
func WithWaitUntilSystemdReachesMultiUserSystem ( ) RunContainerOpt { re , err := regexp . Compile ( " " ) if err != nil { panic ( err ) } return WithWaitUntilLogRegexpMatches ( re ) }
WithWaitUntilSystemdReachesMultiUserSystem waits until the systemd in the container
reaches "Multi-User System" target if is using cgroups v2, so that `docker exec` can be
executed safely without breaking cgroup v2 hierarchy.
WithWaitUntilSystemdReachesMultiUserSystem waits until the systemd in the container reaches " Multi - User System " target if is using cgroups v2 so that ` docker exec ` can be executed safely without breaking cgroup v2 hierarchy .