Documentation ¶
Index ¶
- Constants
- func GetGoogleClient(clientset kubernetes.Interface, namespace string, ...) (*http.Client, error)
- func Int64Value(v *int64) int64
- func IsErrorAlreadyExists(err error) bool
- func IsErrorBadRequest(err error) bool
- func IsErrorNotFound(err error) bool
- func LateInitializeInt64(i *int64, from int64) *int64
- func LateInitializeString(s *string, from string) *string
- func StringValue(v *string) string
- func TestPermissions(creds *google.Credentials, permissions []string) error
- type ProjectInfo
Constants ¶
const DefaultScope = cloudresourcemanager.CloudPlatformScope
DefaultScope is the default scope to use for a GCP client
Variables ¶
This section is empty.
Functions ¶
func GetGoogleClient ¶
func GetGoogleClient(clientset kubernetes.Interface, namespace string, secretKey v1.SecretKeySelector, scopes ...string) (*http.Client, error)
GetGoogleClient returns a client object that can be used to interact with the Google API
func Int64Value ¶
Int64Value converts the supplied int64 pointer to an int, returning zero if the pointer is nil.
func IsErrorAlreadyExists ¶
IsErrorAlreadyExists gets a value indicating whether the given error represents a "conflict" response from the Google API
func IsErrorBadRequest ¶
IsErrorBadRequest gets a value indicating whether the given error represents a "bad request" response from the Google API
func IsErrorNotFound ¶
IsErrorNotFound gets a value indicating whether the given error represents a "not found" response from the Google API
func LateInitializeInt64 ¶
LateInitializeInt64 initializes i, presumed to be an optional field of a Kubernetes API object's spec per Kubernetes "late initialization" semantics. i is returned unchanged if it is non-nil or from is 0, otherwise a pointer to from is returned. https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#late-initialization
func LateInitializeString ¶
LateInitializeString initializes s, presumed to be an optional field of a Kubernetes API object's spec per Kubernetes "late initialization" semantics. s is returned unchanged if it is non-nil or from is the empty string, otherwise a pointer to from is returned. https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#late-initialization
func StringValue ¶
StringValue converts the supplied string pointer to a string, returning the empty string if the pointer is nil.
func TestPermissions ¶
func TestPermissions(creds *google.Credentials, permissions []string) error
TestPermissions tests service account permission using provided credentials and assert that it has all the provided permissions. - return nil - if all permissions are found - return an error - if one or more expected permissions are not found
Types ¶
type ProjectInfo ¶
type ProjectInfo struct { // Name: The user-assigned display name of the Project. Name string // ID: The unique, user-assigned ID of the Project. ID string // Number: The number uniquely identifying the project. Number int64 // CreateTime: Project Creation time. CreateTime string // Labels: The labels associated with this Project. Labels map[string]string }
ProjectInfo represent GCP Project information
func Project ¶
func Project(creds *google.Credentials) (*ProjectInfo, error)
Project returns project information