internal

package
v0.0.0-...-ac903f2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TerraformVarServiceAccount is the name of the terraform service account environment variable.
	TerraformVarServiceAccount = "TF_VAR_SERVICEACCOUNT"
)

Variables

View Source
var (
	// Scheme is a scheme with the types relevant for GCP actuators.
	Scheme *runtime.Scheme
)

Functions

func ExtractServiceAccountProjectID

func ExtractServiceAccountProjectID(serviceAccountJSON []byte) (string, error)

ExtractServiceAccountProjectID extracts the project id from the given service account JSON.

func GetServiceAccountData

func GetServiceAccountData(ctx context.Context, c client.Client, namespace, name string) ([]byte, error)

GetServiceAccountData retrieves the specified service account.

func InfrastructureConfigFromInfrastructure

func InfrastructureConfigFromInfrastructure(infra *extensionsv1alpha1.Infrastructure) (*gcpv1alpha1.InfrastructureConfig, error)

InfrastructureConfigFromInfrastructure extracts the InfrastructureConfig from the ProviderConfig section of the given Infrastructure.

func NewTerraformer

func NewTerraformer(
	restConfig *rest.Config,
	serviceAccount *ServiceAccount,
	purpose,
	namespace,
	name string,
) (*terraformer.Terraformer, error)

NewTerraformer initializes a new Terraformer that has the ServiceAccount credentials.

func ReadServiceAccountSecret

func ReadServiceAccountSecret(secret *corev1.Secret) ([]byte, error)

ReadServiceAccountSecret reads the ServiceAccount from the given secret.

func TerraformerVariablesEnvironmentFromServiceAccount

func TerraformerVariablesEnvironmentFromServiceAccount(account *ServiceAccount) (map[string]string, error)

TerraformerVariablesEnvironmentFromServiceAccount computes the Terraformer variables environment from the given ServiceAccount.

Types

type ServiceAccount

type ServiceAccount struct {
	// Raw is the raw representation of the GCP service account.
	Raw []byte
	// ProjectID is the project id the service account is associated to.
	ProjectID string
}

ServiceAccount represents a GCP service account.

func GetServiceAccount

func GetServiceAccount(ctx context.Context, c client.Client, namespace, name string) (*ServiceAccount, error)

GetServiceAccount retrieves the ServiceAccount from the secret with the given namespace and name.

Directories

Path Synopsis
mock
client
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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