Documentation ¶
Index ¶
- func CreateBucket(bucket, project string) error
- func DownloadFile(file, url string) (int64, error)
- func RollbackDeployment(namespace, name string, info ClusterInfo) error
- func StorageUpload(bucket, object, local string) (int64, error)
- func UnavailableReplicas(namespace, name string, info ClusterInfo) (int32, error)
- func UpdateDeployment(namespace, name, container, docker string, info ClusterInfo) error
- type BuildResult
- type BuildStatus
- type ClusterInfo
- type LatestRelease
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBucket ¶
CreateBucket creates a new bucket on Google Storage.
func DownloadFile ¶
DownloadFile downloads a file from a given url and saves it in the local filesystem.
func RollbackDeployment ¶
func RollbackDeployment(namespace, name string, info ClusterInfo) error
RollbackDeployment reverts the deployment back to its previous state.
func StorageUpload ¶
StorageUpload uploads a local file to Google Storage bucket.
func UnavailableReplicas ¶
func UnavailableReplicas(namespace, name string, info ClusterInfo) (int32, error)
UnavailableReplicas returns the number of unavailable deployment instances for a given deployment.
func UpdateDeployment ¶
func UpdateDeployment(namespace, name, container, docker string, info ClusterInfo) error
UpdateDeployment updates a deployment object by adding a new docker image value and triggering a rolling deployment in the process.
Types ¶
type BuildResult ¶
type BuildResult struct { ID string Status BuildStatus LogURL string }
BuildResult represents build info returned by build operations.
func CreateBuild ¶
func CreateBuild(project, name, bucket, object string, tags []string) (BuildResult, error)
CreateBuild creates and starts a CloudBuild on GCP.
func GetBuild ¶
func GetBuild(project, id string) (BuildResult, error)
GetBuild retrieves the latest build status for a given GCP Cloud Build.
type BuildStatus ¶
type BuildStatus int
BuildStatus referes to Cloud Build status.
const ( // UnknownBuildStatus refers to an edge case wherein the status is unknown. UnknownBuildStatus BuildStatus = iota // QueuedBuildStatus means the build is waiting in the queue to be processed. QueuedBuildStatus // WorkingBuildStatus means the build is in progress. WorkingBuildStatus // SuccessBuildStatus means the build has completed successfully. SuccessBuildStatus // FailureBuildStatus means the build ended because of user failure. FailureBuildStatus // InternalErrorBuildStatus means the build ended because of an error in the build system. InternalErrorBuildStatus // TimeoutBuildStatus means the build ended because it ran too long. TimeoutBuildStatus // CanceledBuildStatus means the build ended because a user has canceled it. CanceledBuildStatus )
type ClusterInfo ¶
type ClusterInfo struct { Username string Password string CAData []byte KeyData []byte CertData []byte Endpoint string }
ClusterInfo contain auth data used to connect to Kubernetes.
func GetGKECluster ¶
func GetGKECluster(project, zone, name string) (ClusterInfo, error)
GetGKECluster returns cluster config for a GKE cluster.
type LatestRelease ¶
LatestRelease represents the GitHub latest release asset download info.
func GetLatestRelease ¶
func GetLatestRelease(shaFile, tarFile string) (LatestRelease, error)
GetLatestRelease returns the LatestRelease information.