Documentation ¶
Overview ¶
Package v7pushaction contains the business logic for orchestrating a V2 app push.
Index ¶
- Constants
- func HandleAppNameOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleAppPathOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleBuildpacksOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleDefaultRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleDiskOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleDockerImageOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleDockerUsernameOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleDropletPathOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleHealthCheckEndpointOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleHealthCheckTimeoutOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleHealthCheckTypeOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleInstancesOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleMemoryOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleNoRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleRandomRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleStackOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleStartCommandOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleStrategyOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func HandleTaskOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func ShouldCreateBitsPackage(plan PushPlan) bool
- func ShouldCreateDeployment(plan PushPlan) bool
- func ShouldCreateDockerPackage(plan PushPlan) bool
- func ShouldCreateDroplet(plan PushPlan) bool
- func ShouldRestart(plan PushPlan) bool
- func ShouldSetDroplet(plan PushPlan) bool
- func ShouldStagePackage(plan PushPlan) bool
- func ShouldStopApplication(plan PushPlan) bool
- type Actor
- func (actor Actor) Actualize(plan PushPlan, progressBar ProgressBar) <-chan *PushEvent
- func (actor Actor) CreateAndMapRoute(orgGUID string, spaceGUID string, app v7action.Application, ...) (Warnings, error)
- func (actor Actor) CreateAndReturnArchivePath(pushPlan PushPlan, unmatchedResources []sharedaction.V3Resource) (string, error)
- func (actor Actor) CreateAndUploadApplicationBits(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (v7action.Package, Warnings, error)
- func (actor Actor) CreateBitsPackageForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreateDeploymentForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreateDockerPackageForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreateDropletForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreatePushPlans(spaceGUID string, orgGUID string, manifest pushmanifestparser.Manifest, ...) ([]PushPlan, v7action.Warnings, error)
- func (actor Actor) GetPrepareApplicationSourceSequence(plan PushPlan) []ChangeApplicationFunc
- func (actor Actor) GetRuntimeSequence(plan PushPlan) []ChangeApplicationFunc
- func (actor Actor) HandleFlagOverrides(baseManifest pushmanifestparser.Manifest, flagOverrides FlagOverrides) (pushmanifestparser.Manifest, error)
- func (actor Actor) MatchResources(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, []sharedaction.V3Resource, Warnings, error)
- func (actor Actor) RestartApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) SetDropletForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) SetupAllResourcesForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func (actor Actor) StagePackageForApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) StopApplication(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
- type Application
- type ChangeApplicationFunc
- type Event
- type FlagOverrides
- type GenesisTechnique
- type HandleFlagOverrideFunc
- type ProgressBar
- type PushEvent
- type PushPlan
- func SetDefaultBitsPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func SetupDeploymentStrategyForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func SetupDropletPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func SetupNoStartForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func SetupNoWaitForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- func SetupTaskAppForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
- type RandomWordGenerator
- type SharedActor
- type UpdatePushPlanFunc
- type V2Actor
- type V7Actor
- type Warnings
Constants ¶
const ProtocolRegexp = "^https?://|^tcp://"
const PushRetries = 3
const URLRegexp = "^(?:https?://|tcp://)?(?:(?:[\\w-]+\\.)|(?:[*]\\.))+\\w+(?:\\:\\d+)?(?:/.*)*(?:\\.\\w+)?$"
const UploadRetries = 3
Variables ¶
This section is empty.
Functions ¶
func HandleAppNameOverride ¶
func HandleAppNameOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleAppPathOverride ¶
func HandleAppPathOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
Overrides the path if path is given. Changes empty paths to pwd. Validates paths
func HandleBuildpacksOverride ¶
func HandleBuildpacksOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleDefaultRouteOverride ¶
func HandleDefaultRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleDiskOverride ¶
func HandleDiskOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleDockerImageOverride ¶
func HandleDockerImageOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleDockerUsernameOverride ¶
func HandleDockerUsernameOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleDropletPathOverride ¶
func HandleDropletPathOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleHealthCheckEndpointOverride ¶
func HandleHealthCheckEndpointOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleHealthCheckTimeoutOverride ¶
func HandleHealthCheckTimeoutOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleHealthCheckTypeOverride ¶
func HandleHealthCheckTypeOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleInstancesOverride ¶
func HandleInstancesOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleMemoryOverride ¶
func HandleMemoryOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleNoRouteOverride ¶
func HandleNoRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleRandomRouteOverride ¶
func HandleRandomRouteOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleStackOverride ¶
func HandleStackOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleStartCommandOverride ¶
func HandleStartCommandOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleStrategyOverride ¶
func HandleStrategyOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func HandleTaskOverride ¶
func HandleTaskOverride(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
func ShouldCreateBitsPackage ¶
func ShouldCreateDeployment ¶
func ShouldCreateDroplet ¶
func ShouldRestart ¶
func ShouldSetDroplet ¶
func ShouldStagePackage ¶
func ShouldStopApplication ¶
Types ¶
type Actor ¶
type Actor struct { V7Actor V7Actor PreparePushPlanSequence []UpdatePushPlanFunc ChangeApplicationSequence func(plan PushPlan) []ChangeApplicationFunc TransformManifestSequence []HandleFlagOverrideFunc RandomWordGenerator RandomWordGenerator // contains filtered or unexported fields }
Actor handles all business logic for Cloud Controller v2 operations.
func NewActor ¶
func NewActor(v3Actor V7Actor, sharedActor SharedActor) *Actor
NewActor returns a new actor.
func (Actor) Actualize ¶
func (actor Actor) Actualize(plan PushPlan, progressBar ProgressBar) <-chan *PushEvent
func (Actor) CreateAndMapRoute ¶
func (actor Actor) CreateAndMapRoute(orgGUID string, spaceGUID string, app v7action.Application, gt GenesisTechnique) (Warnings, error)
func (Actor) CreateAndReturnArchivePath ¶
func (actor Actor) CreateAndReturnArchivePath(pushPlan PushPlan, unmatchedResources []sharedaction.V3Resource) (string, error)
func (Actor) CreateAndUploadApplicationBits ¶
func (Actor) CreateBitsPackageForApplication ¶
func (Actor) CreateDeploymentForApplication ¶
func (Actor) CreateDockerPackageForApplication ¶
func (Actor) CreateDropletForApplication ¶
func (Actor) CreatePushPlans ¶
func (actor Actor) CreatePushPlans( spaceGUID string, orgGUID string, manifest pushmanifestparser.Manifest, overrides FlagOverrides, ) ([]PushPlan, v7action.Warnings, error)
CreatePushPlans returns a set of PushPlan objects based off the inputs provided. It's assumed that all flag and argument and manifest combinations have been validated prior to calling this function.
func (Actor) GetPrepareApplicationSourceSequence ¶
func (actor Actor) GetPrepareApplicationSourceSequence(plan PushPlan) []ChangeApplicationFunc
func (Actor) GetRuntimeSequence ¶
func (actor Actor) GetRuntimeSequence(plan PushPlan) []ChangeApplicationFunc
func (Actor) HandleFlagOverrides ¶
func (actor Actor) HandleFlagOverrides( baseManifest pushmanifestparser.Manifest, flagOverrides FlagOverrides, ) (pushmanifestparser.Manifest, error)
func (Actor) MatchResources ¶
func (actor Actor) MatchResources(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, []sharedaction.V3Resource, Warnings, error)
MatchResources returns back a list of matched and unmatched resources for the provided resources.
func (Actor) RestartApplication ¶
func (Actor) SetDropletForApplication ¶
func (Actor) SetupAllResourcesForPushPlan ¶
func (actor Actor) SetupAllResourcesForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func (Actor) StagePackageForApplication ¶
func (Actor) StopApplication ¶
type Application ¶
type Application struct { v2action.Application Buildpacks []string Stack v2action.Stack }
func (Application) CalculatedBuildpacks ¶
func (app Application) CalculatedBuildpacks() []string
CalculatedBuildpacks will return back the buildpacks for the application.
func (*Application) SetStack ¶
func (app *Application) SetStack(stack v2action.Stack)
func (Application) String ¶
func (app Application) String() string
type ChangeApplicationFunc ¶
type ChangeApplicationFunc func(pushPlan PushPlan, eventStream chan<- *PushEvent, progressBar ProgressBar) (PushPlan, Warnings, error)
ChangeApplicationFunc is a function that is used by Actualize to setup application for staging, droplet creation, etc.
type Event ¶
type Event string
const ( ApplyManifest Event = "Applying manifest" ApplyManifestComplete Event = "Applying manifest Complete" CreatingArchive Event = "creating archive" CreatingDroplet Event = "creating droplet" CreatingPackage Event = "creating package" PollingBuild Event = "polling build" ReadingArchive Event = "reading archive" ResourceMatching Event = "resource matching" RestartingApplication Event = "restarting application" RestartingApplicationComplete Event = "restarting application complete" RetryUpload Event = "retry upload" SetDockerImage Event = "setting docker properties" SetDockerImageComplete Event = "completed setting docker properties" SetDropletComplete Event = "set droplet complete" SettingDroplet Event = "setting droplet" StagingComplete Event = "staging complete" StartingDeployment Event = "starting deployment" StartingStaging Event = "starting staging" StoppingApplication Event = "stopping application" StoppingApplicationComplete Event = "stopping application complete" UploadDropletComplete Event = "upload droplet complete" UploadingApplication Event = "uploading application" UploadingApplicationWithArchive Event = "uploading application with archive" UploadingDroplet Event = "uploading droplet" UploadWithArchiveComplete Event = "upload complete" WaitingForDeployment Event = "waiting for deployment" )
type FlagOverrides ¶
type FlagOverrides struct { AppName string Buildpacks []string Stack string Disk string DropletPath string DockerImage string DockerPassword string DockerUsername string HealthCheckEndpoint string HealthCheckTimeout int64 HealthCheckType constant.HealthCheckType Instances types.NullInt Memory string NoStart bool NoWait bool ProvidedAppPath string NoRoute bool RandomRoute bool StartCommand types.FilteredString Strategy constant.DeploymentStrategy ManifestPath string PathsToVarsFiles []string Vars []template.VarKV NoManifest bool Task bool }
type GenesisTechnique ¶
type GenesisTechnique int
const ( DefaultRoute GenesisTechnique = iota RandomRoute )
type HandleFlagOverrideFunc ¶
type HandleFlagOverrideFunc func(manifest pushmanifestparser.Manifest, overrides FlagOverrides) (pushmanifestparser.Manifest, error)
type ProgressBar ¶
type PushPlan ¶
type PushPlan struct { SpaceGUID string OrgGUID string Application v7action.Application NoStart bool NoWait bool Strategy constant.DeploymentStrategy TaskTypeApplication bool DockerImageCredentials v7action.DockerImageCredentials Archive bool BitsPath string DropletPath string AllResources []sharedaction.V3Resource PackageGUID string DropletGUID string }
func SetDefaultBitsPathForPushPlan ¶
func SetDefaultBitsPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func SetupDeploymentStrategyForPushPlan ¶
func SetupDeploymentStrategyForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func SetupDropletPathForPushPlan ¶
func SetupDropletPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func SetupNoStartForPushPlan ¶
func SetupNoStartForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func SetupNoWaitForPushPlan ¶
func SetupNoWaitForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
func SetupTaskAppForPushPlan ¶
func SetupTaskAppForPushPlan(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
type RandomWordGenerator ¶
RandomWordGenerator returns random words.
type SharedActor ¶
type SharedActor interface {}
type UpdatePushPlanFunc ¶
type UpdatePushPlanFunc func(pushPlan PushPlan, overrides FlagOverrides) (PushPlan, error)
UpdatePushPlanFunc is a function that is used by CreatePushPlans to setup push plans for the push command.
type V2Actor ¶
type V2Actor interface { MapRouteToApplication(routeGUID string, appGUID string) (v2action.Warnings, error) CreateRoute(route v2action.Route, generatePort bool) (v2action.Route, v2action.Warnings, error) FindRouteBoundToSpaceWithSettings(route v2action.Route) (v2action.Route, v2action.Warnings, error) GetApplicationRoutes(applicationGUID string) (v2action.Routes, v2action.Warnings, error) GetOrganizationDomains(orgGUID string) ([]v2action.Domain, v2action.Warnings, error) }
type V7Actor ¶
type V7Actor interface { CreateApplicationDroplet(appGUID string) (v7action.Droplet, v7action.Warnings, error) CreateApplicationInSpace(app v7action.Application, spaceGUID string) (v7action.Application, v7action.Warnings, error) CreateBitsPackageByApplication(appGUID string) (v7action.Package, v7action.Warnings, error) CreateDeployment(appGUID string, dropletGUID string) (string, v7action.Warnings, error) CreateDockerPackageByApplication(appGUID string, dockerImageCredentials v7action.DockerImageCredentials) (v7action.Package, v7action.Warnings, error) CreateRoute(spaceGUID, domainName, hostname, path string) (v7action.Route, v7action.Warnings, error) GetApplicationByNameAndSpace(appName string, spaceGUID string) (v7action.Application, v7action.Warnings, error) GetApplicationDroplets(appName string, spaceGUID string) ([]v7action.Droplet, v7action.Warnings, error) GetApplicationRoutes(appGUID string) ([]v7action.Route, v7action.Warnings, error) GetApplicationsByNamesAndSpace(appNames []string, spaceGUID string) ([]v7action.Application, v7action.Warnings, error) GetDefaultDomain(orgGUID string) (v7action.Domain, v7action.Warnings, error) GetDomain(domainGUID string) (v7action.Domain, v7action.Warnings, error) GetRouteByAttributes(domainName, domainGUID, hostname, path string) (v7action.Route, v7action.Warnings, error) GetRouteDestinationByAppGUID(routeGUID string, appGUID string) (v7action.RouteDestination, v7action.Warnings, error) MapRoute(routeGUID string, appGUID string) (v7action.Warnings, error) PollBuild(buildGUID string, appName string) (v7action.Droplet, v7action.Warnings, error) PollPackage(pkg v7action.Package) (v7action.Package, v7action.Warnings, error) PollStart(appGUID string, noWait bool) (v7action.Warnings, error) PollStartForRolling(appGUID string, deploymentGUID string, noWait bool) (v7action.Warnings, error) ResourceMatch(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, v7action.Warnings, error) RestartApplication(appGUID string, noWait bool) (v7action.Warnings, error) ScaleProcessByApplication(appGUID string, process v7action.Process) (v7action.Warnings, error) SetApplicationDroplet(appGUID string, dropletGUID string) (v7action.Warnings, error) SetApplicationManifest(appGUID string, rawManifest []byte) (v7action.Warnings, error) SetSpaceManifest(spaceGUID string, rawManifest []byte) (v7action.Warnings, error) StageApplicationPackage(pkgGUID string) (v7action.Build, v7action.Warnings, error) StopApplication(appGUID string) (v7action.Warnings, error) UnmapRoute(routeGUID string, destinationGUID string) (v7action.Warnings, error) UpdateApplication(app v7action.Application) (v7action.Application, v7action.Warnings, error) UpdateProcessByTypeAndApplication(processType string, appGUID string, updatedProcess v7action.Process) (v7action.Warnings, error) UploadBitsPackage(pkg v7action.Package, matchedResources []sharedaction.V3Resource, newResources io.Reader, newResourcesLength int64) (v7action.Package, v7action.Warnings, error) UploadDroplet(dropletGUID string, dropletPath string, progressReader io.Reader, fileSize int64) (v7action.Warnings, error) }
Source Files ¶
- actor.go
- actualize.go
- application.go
- change_application_func.go
- create_bits_package_for_application.go
- create_deployment_for_push_plan.go
- create_docker_package_for_application.go
- create_droplet_for_application.go
- create_push_plans.go
- event.go
- handle_app_name_override.go
- handle_app_path_override.go
- handle_buildpacks_override.go
- handle_default_route_override.go
- handle_disk_override.go
- handle_docker_image_override.go
- handle_docker_username_override.go
- handle_droplet_path_override.go
- handle_flag_override_func.go
- handle_flag_overrides.go
- handle_health_check_endpoint_override.go
- handle_health_check_timeout_override.go
- handle_health_check_type_override.go
- handle_instances_override.go
- handle_memory_override.go
- handle_no_route_override.go
- handle_random_route_override.go
- handle_stack_override.go
- handle_start_command_override.go
- handle_strategy_override.go
- handle_task_override.go
- progress_bar.go
- push_plan.go
- random_word_generator.go
- resource_match.go
- restart_application.go
- route.go
- sequence.go
- set_default_bits_path_for_push_plan.go
- set_droplet_for_application.go
- setup_all_resources_for_push_plan.go
- setup_deployment_strategy_for_push_plan.go
- setup_droplet_path_for_push_plan.go
- setup_no_start_for_push_plan.go
- setup_no_wait_for_push_plan.go
- setup_task_app_for_push_plan.go
- shared_actor.go
- stage_package_for_application.go
- stop_application.go
- update_push_plan_func.go
- v2_actor.go
- v7_actor.go