Documentation ¶
Index ¶
- Constants
- func ExtractServiceAccountProjectID(serviceAccountJSON []byte) (string, error)
- func GetServiceAccountData(ctx context.Context, c client.Client, secretRef corev1.SecretReference) ([]byte, error)
- func NewTerraformer(restConfig *rest.Config, purpose, namespace, name string) (terraformer.Terraformer, error)
- func NewTerraformerWithAuth(restConfig *rest.Config, purpose, namespace, name string, ...) (terraformer.Terraformer, error)
- func ReadServiceAccountSecret(secret *corev1.Secret) ([]byte, error)
- func SetTerraformerVariablesEnvironment(tf terraformer.Terraformer, serviceAccount *ServiceAccount) (terraformer.Terraformer, error)
- func TerraformerVariablesEnvironmentFromServiceAccount(account *ServiceAccount) (map[string]string, error)
- type ServiceAccount
Constants ¶
const (
// CloudProviderConfigName is the name of the configmap containing the cloud provider config.
CloudProviderConfigName = "cloud-provider-config"
)
const (
// TerraformVarServiceAccount is the name of the terraform service account environment variable.
TerraformVarServiceAccount = "TF_VAR_SERVICEACCOUNT"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractServiceAccountProjectID ¶
ExtractServiceAccountProjectID extracts the project id from the given service account JSON.
func GetServiceAccountData ¶
func GetServiceAccountData(ctx context.Context, c client.Client, secretRef corev1.SecretReference) ([]byte, error)
GetServiceAccountData retrieves the service account specified by the secret reference.
func NewTerraformer ¶
func NewTerraformer( restConfig *rest.Config, purpose, namespace, name string, ) (terraformer.Terraformer, error)
NewTerraformer initializes a new Terraformer.
func NewTerraformerWithAuth ¶ added in v1.4.0
func NewTerraformerWithAuth( restConfig *rest.Config, purpose, namespace, name string, serviceAccount *ServiceAccount, ) (terraformer.Terraformer, error)
NewTerraformerWithAuth initializes a new Terraformer that has the ServiceAccount credentials.
func ReadServiceAccountSecret ¶
ReadServiceAccountSecret reads the ServiceAccount from the given secret.
func SetTerraformerVariablesEnvironment ¶ added in v1.4.0
func SetTerraformerVariablesEnvironment(tf terraformer.Terraformer, serviceAccount *ServiceAccount) (terraformer.Terraformer, error)
SetTerraformerVariablesEnvironment sets the environment variables based on the given service account.
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, secretRef corev1.SecretReference) (*ServiceAccount, error)
GetServiceAccount retrieves the ServiceAccount from the secret with the given secret reference.