secrets

package
v0.0.0-...-351f9be Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SecretGroupVersionResource = schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "secrets",
}

SecretGroupVersionResource is the required Group Version Resource for accessing secrets in a cluster, using the dynamic client.

Functions

func CreateSecret

func CreateSecret(secretResource dynamic.ResourceInterface, secret *corev1.Secret) (*corev1.Secret, error)

CreateSecret is a helper function that uses the dynamic client to create a secret in a namespace for a specific cluster.

func CreateSecretForCluster

func CreateSecretForCluster(client *rancher.Client, secret *corev1.Secret, clusterID, namespace string) (*corev1.Secret, error)

CreateSecretForCluster is a helper function that uses the rancher client to create a secret in a namespace for a specific cluster.

func GetSecretByName

func GetSecretByName(client *rancher.Client, clusterID, namespace, secretName string, getOpts metav1.GetOptions) (*coreV1.Secret, error)

GetSecretByName is a helper function that uses the dynamic client to get a specific secret on a namespace for a specific cluster.

func NewBasicAuthSecret

func NewBasicAuthSecret(name, namespace, username, password string) *coreV1.Secret

NewBasicAuthSecret is a constructor for a Basic Auth secret type

func PatchSecret

func PatchSecret(client *rancher.Client, clusterID, secretName, namespace string, patchType types.PatchType, patchOp PatchOP, patchPath, patchData string, patchOpts metav1.PatchOptions) (*coreV1.Secret, error)

PatchSecret is a helper function that uses the dynamic client to patch a secret in a namespace for a specific cluster. Different secret operations are supported: add, replace, remove.

Types

type PatchOP

type PatchOP string
const (
	AddPatchOP     PatchOP = "add"
	ReplacePatchOP PatchOP = "replace"
	RemovePatchOP  PatchOP = "remove"
)

type SecretList

type SecretList struct {
	Items []corev1.Secret
}

SecretList is a struct that contains a list of secrets.

func ListSecrets

func ListSecrets(client *rancher.Client, clusterID, namespace string, listOpts metav1.ListOptions) (*SecretList, error)

ListSecrets is a helper function that uses the dynamic client to list secrets in a cluster with its list options.

func (*SecretList) Names

func (list *SecretList) Names() []string

Names is a method that accepts SecretList as a receiver, returns each secret name in the list as a new slice of strings.

Jump to

Keyboard shortcuts

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