Documentation ¶
Index ¶
- Constants
- Variables
- func BucketExists(projectID string, bucketName string) (bool, error)
- func CheckPermission(perm string, projectID string) (bool, error)
- func CleanupServiceAccountKeys(serviceAccount string, projectID string) error
- func ClusterZone(cluster string) (string, error)
- func CreateBucket(projectID string, bucketName string, location string) error
- func CreateKmsKey(keyName string, keyringName string, projectID string) error
- func CreateKmsKeyring(keyringName string, projectID string) error
- func CreateServiceAccountKey(serviceAccount string, projectID string, keyPath string) error
- func DeleteAllObjectsInBucket(bucketName string) error
- func DeleteBucket(bucketName string) error
- func DeleteServiceAccount(serviceAccount string, projectID string, roles []string) error
- func DeleteServiceAccountKey(serviceAccount string, projectID string, key string) error
- func EnableAPIs(projectID string, apis ...string) error
- func FindBucket(bucketName string) bool
- func FindLatestImageTag(output string) (string, error)
- func FindServiceAccount(serviceAccount string, projectID string) bool
- func GetCurrentProject() (string, error)
- func GetEnabledApis(projectID string) ([]string, error)
- func GetGoogleMachineTypes() []string
- func GetGoogleProjects() ([]string, error)
- func GetGoogleRegions(project string) ([]string, error)
- func GetGoogleZones(project string) ([]string, error)
- func GetOrCreateServiceAccount(serviceAccount string, projectID string, clusterConfigDir string, ...) (string, error)
- func GetRegionFromZone(zone string) string
- func GetServiceAccountKeys(serviceAccount string, projectID string) ([]string, error)
- func IsKmsKeyAvailable(keyName string, keyringName string, projectID string) bool
- func IsKmsKeyringAvailable(keyringName string, projectID string) bool
- func Login(serviceAccountKeyPath string, skipLogin bool) error
- type ImageTagInfo
Constants ¶
const KmsLocation = "global"
KmsLocation indicates the location used by the Google KMS service
Variables ¶
var ( // RequiredServiceAccountRoles the roles required to create a cluster with terraform RequiredServiceAccountRoles = []string{"roles/compute.instanceAdmin.v1", "roles/iam.serviceAccountActor", "roles/container.clusterAdmin", "roles/container.admin", "roles/container.developer", "roles/storage.objectAdmin", "roles/editor"} // KanikoServiceAccountRoles the roles required to run kaniko with GCS KanikoServiceAccountRoles = []string{"roles/storage.admin", "roles/storage.objectAdmin", "roles/storage.objectCreator"} )
var PROJECT_LIST_HEADER = "PROJECT_ID"
Functions ¶
func BucketExists ¶
BucketExists checks if a Google Storage bucket exists
func CheckPermission ¶
CheckPermission checks permission on the given project
func CleanupServiceAccountKeys ¶
CleanupServiceAccountKeys remove all keys from given service account
func ClusterZone ¶
ClusterZone retrives the zone of GKE cluster description
func CreateBucket ¶
CreateBucket creates a new Google Storage bucket
func CreateKmsKey ¶
CreateKmsKey creates a new KMS key in the given keyring
func CreateKmsKeyring ¶
CreateKmsKeyring creates a new KMS keyring
func CreateServiceAccountKey ¶
CreateServiceAccountKey creates a new service account key and downloads into the given file
func DeleteAllObjectsInBucket ¶
DeleteAllObjectsInBucket deletes all objects in a Google Storage bucket
func DeleteBucket ¶
DeleteBucket deletes a Google storage bucket
func DeleteServiceAccount ¶
DeleteServiceAccount deletes a service account and its role bindings
func DeleteServiceAccountKey ¶
DeleteServiceAccountKey deletes a service account key
func EnableAPIs ¶
EnableAPIs enables APIs for the given services
func FindLatestImageTag ¶ added in v1.3.1038
FindLatestImageTag returns the latest image tag from the JSON output of the command ` gcloud container images list-tags gcr.io/jenkinsxio/builder-maven --format jsonhig`
func FindServiceAccount ¶
FindServiceAccount checks if a service account exists
func GetCurrentProject ¶
func GetEnabledApis ¶
GetEnabledApis returns which services have the API enabled
func GetGoogleMachineTypes ¶
func GetGoogleMachineTypes() []string
func GetGoogleProjects ¶
func GetGoogleRegions ¶ added in v1.3.1062
func GetGoogleZones ¶
func GetOrCreateServiceAccount ¶
func GetOrCreateServiceAccount(serviceAccount string, projectID string, clusterConfigDir string, roles []string) (string, error)
GetOrCreateServiceAccount retrieves or creates a GCP service account. It will return the path to the file where the service account token is stored
func GetRegionFromZone ¶
GetRegionFromZone parses the region from a GCP zone name
func GetServiceAccountKeys ¶
GetServiceAccountKeys returns all keys of a service account
func IsKmsKeyAvailable ¶
IsKmsKeyAvailable checks if the KMS key is already available
func IsKmsKeyringAvailable ¶
IsKmsKeyringAvailable checks if the KMS keyring is already available
Types ¶
type ImageTagInfo ¶ added in v1.3.1038
ImageTagInfo contains tag information for container images