secret

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	SecretData string
}

type Metadata

type Metadata struct {
	Name   string      `yaml:"name"`
	Labels interface{} `yaml:"labels"`
}

type Secret

type Secret struct {
	// Directory - directory where secret will be created
	Directory string
	// YamlManifest - secret specification
	YamlManifest SecretYaml
}

Secret holds information necessary to create a secret

func New

func New(directory string, secretYaml SecretYaml) Secret

New create a k8s Secret manifest object from the specified manifest.

func (*Secret) Apply

func (s *Secret) Apply(namespace, kubeconfig string) error

Apply creates a secret manifests and applies it in the cluster (specified by given kubeconfig) in the specified namespace if the kubeconfig is left empty, it uses default kubeconfig

type SecretYaml

type SecretYaml struct {
	APIVersion string   `yaml:"apiVersion"`
	Kind       string   `yaml:"kind"`
	Metadata   Metadata `yaml:"metadata"`
	SecretType string   `yaml:"type"`
	Data       Data     `yaml:"data"`
}

func NewYaml

func NewYaml(md Metadata, data Data) SecretYaml

NewYaml created a template with pre-defined defaults and optional metadata & data fields.

Jump to

Keyboard shortcuts

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