env

package
v3.0.0-rc39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionOriginVar                          = "OSVC_ACTION_ORIGIN"
	ActionOriginUser            ActionOrigin = "user"
	ActionOriginDaemonAPI       ActionOrigin = "daemon/api"
	ActionOriginDaemonMonitor   ActionOrigin = "daemon/monitor"
	ActionOriginDaemonScheduler ActionOrigin = "daemon/scheduler"

	NameVar      = "OSVC_NAME"
	NamespaceVar = "OSVC_NAMESPACE"
	KindVar      = "OSVC_KIND"
	ContextVar   = "OSVC_CONTEXT"

	NoLogFileVar = "OSVC_NO_LOG_FILE"

	// JoinTokenVar is the environment variable the "cluster join" command
	// reads the join token from when --token is not set. The daemon uses it
	// to hand a token to the join it forks, so the token never appears in the
	// process command line, which any user can read.
	JoinTokenVar = "OSVC_JOIN_TOKEN"

	// CredentialVar is the environment variable the "cluster leave" command
	// reads the <username>:<password> of the user to create on the leaving
	// node from. The daemon uses it to hand a credential to the leave it
	// forks. There is no flag carrying the value itself, for the same reason
	// the join token has none: the process command line is world readable.
	CredentialVar = "OSVC_CREDENTIAL"
)

Functions

func Context

func Context() string

Context returns the identifier of a remote cluster endpoint and credentials configuration via the OSVC_CONTEXT variable.

func HasDaemonMonitorOrigin

func HasDaemonMonitorOrigin() bool

HasDaemonMonitorOrigin returns true if the environment variable OSVC_ACTION_ORIGIN is set to "daemon/monitor". The opensvc daemon sets this variable on every command it executes.

func HasDaemonOrigin

func HasDaemonOrigin() bool

HasDaemonOrigin returns true if the environment variable OSVC_ACTION_ORIGIN is set to one of the daemon origins: "daemon/monitor", "daemon/api" or "daemon/scheduler". The opensvc daemon sets this variable on every command it executes.

func HasDaemonSchedulerOrigin

func HasDaemonSchedulerOrigin() bool

HasDaemonSchedulerOrigin returns true if the environment variable OSVC_ACTION_ORIGIN is set to "daemon/scheduler", which the daemon sets on the commands its scheduler runs.

func Kind

func Kind() string

Kind returns the object kind filter forced via the OSVC_NAMESPACE environment variable.

func Namespace

func Namespace() string

Namespace returns the namespace filter forced via the OSVC_NAMESPACE environment variable.

func NoLogFile

func NoLogFile() bool

func NoLogFileSetenvArg

func NoLogFileSetenvArg() string

Types

type ActionOrigin

type ActionOrigin string

func Origin

func Origin() ActionOrigin

Origin returns the action origin using a env var that the daemon sets when executing a CRM action.

func (ActionOrigin) Var

func (t ActionOrigin) Var() string

Var returns the arg to pass to environment variable setter functions to hint the called CRM command was launched from a daemon policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL