secret

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Name   string            `yaml:"name"`
	Labels map[string]string `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       map[string]string `yaml:"data"`
}

func NewYaml

func NewYaml(md Metadata, data map[string]string) 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