util

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderName is the name of Provider object
	ProviderName = "default"
	// ProviderNamespace is the namespace of Provider object
	ProviderNamespace = "default"
)
View Source
const (
	EnvAlicloudAcessKey  = "ALICLOUD_ACCESS_KEY"
	EnvAlicloudSecretKey = "ALICLOUD_SECRET_KEY"
	EnvAlicloudRegion    = "ALICLOUD_REGION"

	EnvAWSAccessKeyID     = "AWS_ACCESS_KEY_ID"
	EnvAWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY"
	EnvAWSDefaultRegion   = "AWS_DEFAULT_REGION"

	EnvGCPCredentialsJSON = "GOOGLE_CREDENTIALS"
	EnvGCPRegion          = "GOOGLE_REGION"
	EnvGCPProject         = "GOOGLE_PROJECT"

	EnvARMClientID       = "ARM_CLIENT_ID"
	EnvARMClientSecret   = "ARM_CLIENT_SECRET"
	EnvARMSubscriptionID = "ARM_SUBSCRIPTION_ID"
	EnvARMTenantID       = "ARM_TENANT_ID"
)

Variables

This section is empty.

Functions

func DecompressTerraformStateSecret added in v0.1.3

func DecompressTerraformStateSecret(data string) ([]byte, error)

DecompressTerraformStateSecret decompress the data of Terraform backend state secret Modified based on Hashicorp code base https://github.com/hashicorp/terraform/blob/fabdf0bea1fa2bf6a9d56cc3ea0f28242bf5e812/backend/remote-state/kubernetes/client.go#L355 Licensed under Mozilla Public License 2.0

func GetProviderCredentials

func GetProviderCredentials(ctx context.Context, k8sClient client.Client, namespace, providerName string) (map[string]string, error)

func RawExtension2Map

func RawExtension2Map(raw *runtime.RawExtension) (map[string]interface{}, error)

RawExtension2Map will convert rawExtension to map This function is copied from oam-dev/kubevela

Types

type AWSCredentials

type AWSCredentials struct {
	AWSAccessKeyID     string `yaml:"awsAccessKeyID"`
	AWSSecretAccessKey string `yaml:"awsSecretAccessKey"`
}

type AlibabaCloudCredentials

type AlibabaCloudCredentials struct {
	AccessKeyID     string `yaml:"accessKeyID"`
	AccessKeySecret string `yaml:"accessKeySecret"`
}

type AzureCredentials added in v0.1.8

type AzureCredentials struct {
	ARMClientID       string `yaml:"armClientID"`
	ARMClientSecret   string `yaml:"armClientSecret"`
	ARMSubscriptionID string `yaml:"armSubscriptionID"`
	ARMTenantID       string `yaml:"armTenantID"`
}

type CloudProvider

type CloudProvider string
const (
	Alibaba CloudProvider = "alibaba"
	AWS     CloudProvider = "aws"
	GCP     CloudProvider = "gcp"
	Azure   CloudProvider = "azure"
)

type ConfigurationType

type ConfigurationType string
const (
	ConfigurationJSON ConfigurationType = "JSON"
	ConfigurationHCL  ConfigurationType = "HCL"
)

func ValidConfiguration

func ValidConfiguration(configuration *v1beta1.Configuration) (ConfigurationType, string, error)

type GCPCredentials added in v0.1.8

type GCPCredentials struct {
	GCPCredentialsJSON string `yaml:"gcpCredentialsJSON"`
	GCPProject         string `yaml:"gcpProject"`
}

Jump to

Keyboard shortcuts

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