Documentation ¶
Index ¶
- Constants
- func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string
- func SetDeploymentAnnotationsTo(deployment *apps.Deployment, rollbackToRS *apps.ReplicaSet)
- func SetFromReplicaSetTemplate(deployment *apps.Deployment, template v1.PodTemplateSpec) *apps.Deployment
- type CleanupArtifactsRequest
- type Controller
- func (cc *Controller) CleanupArtifacts(c *gin.Context, ca CleanupArtifactsRequest)
- func (cc *Controller) Delete(c *gin.Context, dm DeleteManifestRequest)
- func (cc *Controller) Deploy(c *gin.Context, dm DeployManifestRequest)
- func (cc *Controller) Patch(c *gin.Context, pm PatchManifestRequest)
- func (cc *Controller) Rollback(c *gin.Context, ur UndoRolloutManifestRequest)
- func (cc *Controller) RollingRestart(c *gin.Context, rr RollingRestartManifestRequest)
- func (cc *Controller) RunJob(c *gin.Context, rj RunJobRequest)
- func (cc *Controller) Scale(c *gin.Context, sm ScaleManifestRequest)
- type DeleteManifestRequest
- type DeleteManifestRequestLabelSelector
- type DeleteManifestRequestLabelSelectors
- type DeleteManifestRequestOptions
- type DeployManifestRequest
- type ManifestCoordinatesResponse
- type ManifestResponse
- type ManifestResponseMoniker
- type Operation
- type Operations
- type OperationsResponse
- type PatchManifestRequest
- type PatchManifestRequestArtifact
- type PatchManifestRequestOptions
- type RollingRestartManifestRequest
- type RunJobRequest
- type ScaleManifestRequest
- type UndoRolloutManifestRequest
Constants ¶
const ( // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" // RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment. RevisionHistoryAnnotation = "deployment.kubernetes.io/revision-history" // DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation // in its replica sets. Helps in separating scaling events from the rollout process and for // determining if the new replica set for a deployment is really saturated. DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas" // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which // is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their // proportions in case the deployment has surge replicas. MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas" )
Variables ¶
This section is empty.
Functions ¶
func CloneAndRemoveLabel ¶
Taken from https://github.com/kubernetes/kubernetes/blob/master/pkg/util/labels/labels.go
CloneAndRemoveLabel clones the given map and returns a new map with the given key removed. Returns the given map, if labelKey is empty.
func SetDeploymentAnnotationsTo ¶
func SetDeploymentAnnotationsTo(deployment *apps.Deployment, rollbackToRS *apps.ReplicaSet)
SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations. This action should be done if and only if the deployment is rolling back to this rs. Note that apply and revision annotations are not changed.
func SetFromReplicaSetTemplate ¶
func SetFromReplicaSetTemplate(deployment *apps.Deployment, template v1.PodTemplateSpec) *apps.Deployment
SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment.
Types ¶
type CleanupArtifactsRequest ¶
type Controller ¶
type Controller struct {
*internal.Controller
}
Controller holds all non request-scoped objects.
func (*Controller) CleanupArtifacts ¶
func (cc *Controller) CleanupArtifacts(c *gin.Context, ca CleanupArtifactsRequest)
func (*Controller) Delete ¶
func (cc *Controller) Delete(c *gin.Context, dm DeleteManifestRequest)
func (*Controller) Deploy ¶
func (cc *Controller) Deploy(c *gin.Context, dm DeployManifestRequest)
Deploy performs a "Deploy (Manifest)" Spinnaker operation. It takes in a list of manifest and the Kubernetes provider to "apply" them to. It adds Spinnaker annotations/labels, and handles any Spinnaker versioning, then applies each manifest one by one.
func (*Controller) Patch ¶
func (cc *Controller) Patch(c *gin.Context, pm PatchManifestRequest)
func (*Controller) Rollback ¶
func (cc *Controller) Rollback(c *gin.Context, ur UndoRolloutManifestRequest)
func (*Controller) RollingRestart ¶
func (cc *Controller) RollingRestart(c *gin.Context, rr RollingRestartManifestRequest)
RollingRestart performs a `kubectl rollout restart` by setting an annotation on a pod template to the current time in RFC3339.
func (*Controller) RunJob ¶
func (cc *Controller) RunJob(c *gin.Context, rj RunJobRequest)
func (*Controller) Scale ¶
func (cc *Controller) Scale(c *gin.Context, sm ScaleManifestRequest)
type DeleteManifestRequest ¶
type DeleteManifestRequest struct { App string `json:"app"` Mode string `json:"mode"` LabelSelectors DeleteManifestRequestLabelSelectors `json:"labelSelectors"` ManifestName string `json:"manifestName"` CloudProvider string `json:"cloudProvider"` Options DeleteManifestRequestOptions `json:"options"` Kinds []string `json:"kinds"` Location string `json:"location"` User string `json:"user"` Account string `json:"account"` }
type DeleteManifestRequestLabelSelectors ¶
type DeleteManifestRequestLabelSelectors struct {
Selectors []DeleteManifestRequestLabelSelector `json:"selectors"`
}
type DeployManifestRequest ¶
type DeployManifestRequest struct { EnableTraffic bool `json:"enableTraffic"` NamespaceOverride string `json:"namespaceOverride"` CloudProvider string `json:"cloudProvider"` Manifests []map[string]interface{} `json:"manifests"` TrafficManagement struct { Options struct { EnableTraffic bool `json:"enableTraffic"` } `json:"options"` Enabled bool `json:"enabled"` } `json:"trafficManagement"` Moniker struct { App string `json:"app"` } `json:"moniker"` Source string `json:"source"` Account string `json:"account"` SkipExpressionEvaluation bool `json:"skipExpressionEvaluation"` RequiredArtifacts []clouddriver.Artifact `json:"requiredArtifacts"` OptionalArtifacts []clouddriver.Artifact `json:"optionalArtifacts"` }
type ManifestResponse ¶
type ManifestResponse struct { Account string `json:"account"` // Artifacts []struct { // CustomKind bool `json:"customKind"` // Metadata struct { // } `json:"metadata"` // Name string `json:"name"` // Reference string `json:"reference"` // Type string `json:"type"` // } `json:"artifacts"` Events []interface{} `json:"events"` Location string `json:"location"` Manifest map[string]interface{} `json:"manifest"` Metrics []interface{} `json:"metrics"` Moniker ManifestResponseMoniker `json:"moniker"` Name string `json:"name"` Status manifest.Status `json:"status"` Warnings []interface{} `json:"warnings"` }
why are artifacts commented out here? possibly causing the problem of artifacts not getting bound correctly
type ManifestResponseMoniker ¶
type Operation ¶
type Operation struct { DeployManifest *DeployManifestRequest `json:"deployManifest"` ScaleManifest *ScaleManifestRequest `json:"scaleManifest"` CleanupArtifacts *CleanupArtifactsRequest `json:"cleanupArtifacts"` DeleteManifest *DeleteManifestRequest `json:"deleteManifest"` UndoRolloutManifest *UndoRolloutManifestRequest `json:"undoRolloutManifest"` RollingRestartManifest *RollingRestartManifestRequest `json:"rollingRestartManifest"` PatchManifest *PatchManifestRequest `json:"patchManifest"` RunJob *RunJobRequest `json:"runJob"` }
type Operations ¶
type Operations []Operation
type OperationsResponse ¶
type PatchManifestRequest ¶
type PatchManifestRequest struct { App string `json:"app"` Cluster string `json:"cluster"` Criteria string `json:"criteria"` // Kind string `json:"kind"` ManifestName string `json:"manifestName"` Source string `json:"source"` Mode string `json:"mode"` PatchBody map[string]interface{} `json:"patchBody"` CloudProvider string `json:"cloudProvider"` AllArtifacts []PatchManifestRequestArtifact `json:"allArtifacts"` Options PatchManifestRequestOptions `json:"options"` // Manifests []map[string]interface{} `json:"manifests"` Location string `json:"location"` Account string `json:"account"` }
type PatchManifestRequestArtifact ¶
type PatchManifestRequestArtifact struct { CustomKind bool `json:"customKind"` Reference string `json:"reference"` Metadata struct { Account string `json:"account"` } `json:"metadata"` Name string `json:"name"` Location string `json:"location"` Type string `json:"type"` Version string `json:"version"` }
type PatchManifestRequestOptions ¶
type PatchManifestRequestOptions struct { MergeStrategy string `json:"mergeStrategy"` Record bool `json:"record"` }
Merge strategy can be "strategic", "json", or "merge".
type RunJobRequest ¶
type ScaleManifestRequest ¶
type UndoRolloutManifestRequest ¶
type UndoRolloutManifestRequest struct { Mode string `json:"mode"` ManifestName string `json:"manifestName"` CloudProvider string `json:"cloudProvider"` Location string `json:"location"` NumRevisionsBack int `json:"numRevisionsBack"` User string `json:"user"` Account string `json:"account"` Revision string `json:"revision"` }