aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/registry/remote.go
blob: ed1a874d635c6798158dfb23ef35690b99d9bb04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package registry

import (
	"os"
	"sync"

	"github.com/containers/libpod/pkg/domain/entities"
	"github.com/spf13/cobra"
)

var (
	// Was --remote given on command line
	remoteOverride bool
	remoteSync     sync.Once
)

// IsRemote returns true if podman was built to run remote
// Use in init() functions as a initialization check
func IsRemote() bool {
	remoteSync.Do(func() {
		remote := &cobra.Command{}
		remote.Flags().BoolVarP(&remoteOverride, "remote", "r", false, "")
		_ = remote.ParseFlags(os.Args)
	})
	return podmanOptions.EngineMode == entities.TunnelMode || remoteOverride
}