MCPcopy Index your code
hub / github.com/containers/toolbox / constructExecArgs

Function constructExecArgs

src/cmd/run.go:555–602  ·  view source on GitHub ↗
(container, preserveFDs string,
	command []string,
	detachKeysSupported bool,
	envOptions []string,
	fallbackToBash bool,
	ttyNeeded bool,
	workDir string)

Source from the content-addressed store, hash-verified

553}
554
555func constructExecArgs(container, preserveFDs string,
556 command []string,
557 detachKeysSupported bool,
558 envOptions []string,
559 fallbackToBash bool,
560 ttyNeeded bool,
561 workDir string) []string {
562
563 logLevelString := podman.LogLevel.String()
564
565 execArgs := []string{
566 "--log-level", logLevelString,
567 "exec",
568 }
569
570 if detachKeysSupported {
571 execArgs = append(execArgs, []string{
572 "--detach-keys", "",
573 }...)
574 }
575
576 execArgs = append(execArgs, envOptions...)
577
578 execArgs = append(execArgs, []string{
579 "--interactive",
580 "--preserve-fds", preserveFDs,
581 }...)
582
583 if ttyNeeded {
584 execArgs = append(execArgs, []string{
585 "--tty",
586 }...)
587 }
588
589 execArgs = append(execArgs, []string{
590 "--user", currentUser.Username,
591 "--workdir", workDir,
592 }...)
593
594 execArgs = append(execArgs, []string{
595 container,
596 }...)
597
598 capShArgs := constructCapShArgs(command, !fallbackToBash)
599 execArgs = append(execArgs, capShArgs...)
600
601 return execArgs
602}
603
604func ensureContainerIsInitialized(container string, entryPointPID int, timestamp time.Time) error {
605 initializedStamp, err := utils.GetInitializedStamp(entryPointPID, currentUser)

Callers 1

runCommandWithFallbacksFunction · 0.85

Calls 1

constructCapShArgsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…