env

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunningInRoxieContainer bool
	RunningInteractively    bool
)

Functions

func DetectClusterType

func DetectClusterType(config KubeConfig, apiResources []string) types.ClusterType

DetectClusterType implements the cluster type detection logic This function is pure and testable - it doesn't invoke kubectl itself

func GetAutoDetectedClusterType added in v0.4.1

func GetAutoDetectedClusterType() types.ClusterType

GetAutoDetectedClusterType returns the current cluster type, initializing if needed

func GetCurrentContext

func GetCurrentContext() string

GetCurrentContext returns the current kubectl context, initializing if needed

func GetStackroxRepositoryTag

func GetStackroxRepositoryTag(log *logger.Logger) (string, error)

func Initialize

func Initialize(log *logger.Logger) error

Initialize performs environment initialization and sets the global variables. Retries on failure to handle race conditions during container startup, which I have observed in relation with podman :U mounts: the container was starting before the gcloud config was writable by the container user, hence GKE authentication failed immediately.

func IsInStackroxRepository

func IsInStackroxRepository(log *logger.Logger) bool

Types

type KubeCluster

type KubeCluster struct {
	Name   string
	Server string
}

KubeCluster represents a cluster in the kubectl configuration

type KubeConfig

type KubeConfig struct {
	CurrentContext string
	Clusters       []KubeCluster
}

KubeConfig represents a simplified kubectl configuration

Jump to

Keyboard shortcuts

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