secret

package
v0.0.0-...-965667f Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GoogleApplicationCredentialsEnvVar is the environment variable used by the
	// Application Default Credentials mechanism. More details can be found at
	// https://developers.google.com/identity/protocols/application-default-credentials.
	GoogleApplicationCredentialsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS"
	// ServiceAccountJSONKeyFileName is the default name of the service account
	// Json key file. This name is added to the service account secret mount path to
	// form the path to the Json key file referred to by GOOGLE_APPLICATION_CREDENTIALS.
	ServiceAccountJSONKeyFileName = "key.json"
	// ServiceAccountSecretVolumeName is the name of the GCP service account secret volume.
	ServiceAccountSecretVolumeName = "gcp-service-account-secret-volume"
)

Variables

This section is empty.

Functions

func AddSecretVolumeToPod

func AddSecretVolumeToPod(secretVolumeName string, secretName string, pod *v1.Pod)

AddSecretVolumeToPod adds a secret volume for the secret with secretName into pod.

func FindGCPServiceAccountSecret

func FindGCPServiceAccountSecret(annotations map[string]string) (string, string, bool)

FindGCPServiceAccountSecret finds the annotation for specifying GCP service account secret and returns the name and mount path of the secret if the annotation is found.

func FindGeneralSecrets

func FindGeneralSecrets(annotations map[string]string) map[string]string

FindGeneralSecrets finds the annotations for specifying general secrets and returns an map of names of the secrets to their mount paths.

func MountSecretToContainer

func MountSecretToContainer(volumeName string, mountPath string, container *v1.Container)

MountSecretToContainer mounts the secret volume with volumeName onto the mountPath into container.

func MountServiceAccountSecretToContainer

func MountServiceAccountSecretToContainer(mountPath string, container *v1.Container)

MountServiceAccountSecretToContainer mounts the service account secret volume with volumeName onto the mountPath into container and also sets environment variable GOOGLE_APPLICATION_CREDENTIALS to the service account key file in the volume.

Types

This section is empty.

Jump to

Keyboard shortcuts

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