sopsenv

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// KonfigureLabelKey `konfigure.giantswarm.io/data=sops-key` is used to fetch Kubernetes
	// Secrets with SOPS keys in order to import them to a temporary location.
	KonfigureLabelKey   = "konfigure.giantswarm.io/data"
	KonfigureLabelValue = "sops-keys"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidConfigError

type InvalidConfigError struct {
	// contains filtered or unexported fields
}

func (*InvalidConfigError) Error

func (e *InvalidConfigError) Error() string

func (*InvalidConfigError) Is

func (e *InvalidConfigError) Is(target error) bool

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

type PgpImportError

type PgpImportError struct {
	// contains filtered or unexported fields
}

func (*PgpImportError) Error

func (e *PgpImportError) Error() string

func (*PgpImportError) Is

func (e *PgpImportError) Is(target error) bool

type SOPSEnv

type SOPSEnv struct {
	// contains filtered or unexported fields
}

func NewSOPSEnv

func NewSOPSEnv(config SOPSEnvConfig) (*SOPSEnv, error)

NewSOPSEnv creates SOPS environment configurator, it works according to the below combinations.

  1. User expects to run SOPS against his local default keychains for GPG and AGE: keysDir="" keysSource="local"

  2. User expects to run SOPS against his custom keychains located under `path`: keysDir="path" keysSource="local"

  3. User expects to run SOPS against Kubernetes-downloaded keys stored at tmp location: keysDir="" keysSource="kubernetes"

  4. User expects to run SOPS against Kubernetes-downloaded keys stored under `path`: keysDir="path" keysSource="kubernetes"

func SetupNewSopsEnvironmentFromFakeKubernetes added in v1.2.0

func SetupNewSopsEnvironmentFromFakeKubernetes(secrets []*corev1.Secret) (*SOPSEnv, error)

func (*SOPSEnv) Cleanup

func (s *SOPSEnv) Cleanup()

func (*SOPSEnv) GetKeysDir

func (s *SOPSEnv) GetKeysDir() string

func (*SOPSEnv) Setup

func (s *SOPSEnv) Setup(ctx context.Context) error

Setup sets up a self-contingent environment for PGP and AGE keys, and temporarily point SOPS to it, by exporting env vars

type SOPSEnvConfig

type SOPSEnvConfig struct {
	K8sClient  kubernetes.Interface
	KeysDir    string
	KeysSource string
	Logger     logr.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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