MCPcopy
hub / github.com/containers/toolbox / callFlatpakSessionHelper

Function callFlatpakSessionHelper

src/cmd/run.go:513–540  ·  view source on GitHub ↗
(container podman.Container)

Source from the content-addressed store, hash-verified

511}
512
513func callFlatpakSessionHelper(container podman.Container) error {
514 name := container.Name()
515 logrus.Debugf("Inspecting mounts of container %s", name)
516
517 var needsFlatpakSessionHelper bool
518
519 mounts := container.Mounts()
520 for _, mount := range mounts {
521 if mount == "/run/host/monitor" {
522 logrus.Debug("Requires org.freedesktop.Flatpak.SessionHelper")
523 needsFlatpakSessionHelper = true
524 break
525 }
526 }
527
528 if !needsFlatpakSessionHelper {
529 return nil
530 }
531
532 fmt.Fprintf(os.Stderr, "Warning: container %s uses deprecated features\n", name)
533 fmt.Fprintf(os.Stderr, "Consider recreating it with Toolbx version 0.0.97 or newer.\n")
534
535 if _, err := utils.CallFlatpakSessionHelper(); err != nil {
536 return err
537 }
538
539 return nil
540}
541
542func constructCapShArgs(command []string, useLoginShell bool) []string {
543 capShArgs := []string{"capsh", "--caps=", "--"}

Callers 1

runCommandFunction · 0.85

Calls 2

NameMethod · 0.65
MountsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…