Documentation ¶
Overview ¶
Package v7pushaction contains the business logic for orchestrating a V2 app push.
Index ¶
- Constants
- type Actor
- func (actor Actor) Actualize(plan PushPlan, progressBar ProgressBar) (<-chan PushPlan, <-chan Event, <-chan Warnings, <-chan error)
- func (actor Actor) CreateAndMapDefaultApplicationRoute(orgGUID string, spaceGUID string, app v7action.Application) (Warnings, error)
- func (actor Actor) CreateAndReturnArchivePath(plan PushPlan, unmatchedResources []sharedaction.V3Resource) (string, error)
- func (actor Actor) CreateAndUploadApplicationBits(plan PushPlan, progressBar ProgressBar, eventStream chan<- Event) (v7action.Package, Warnings, error)
- func (actor Actor) CreateBitsPackageForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreateDockerPackageForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) CreatePushPlans(appNameArg string, spaceGUID string, orgGUID string, parser ManifestParser, ...) ([]PushPlan, error)
- func (actor Actor) DefaultDomain(orgGUID string) (v2action.Domain, Warnings, error)
- func (actor Actor) MatchResources(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, []sharedaction.V3Resource, Warnings, error)
- func (actor Actor) PrepareSpace(pushPlans []PushPlan, manifestParser ManifestParser) (<-chan []PushPlan, <-chan Event, <-chan Warnings, <-chan error)
- func (actor Actor) ScaleWebProcessForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) SetDropletForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) SetupAllResourcesForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func (actor Actor) StagePackageForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) StopApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) UpdateApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) UpdateApplicationSettings(pushPlans []PushPlan) ([]PushPlan, Warnings, error)
- func (actor Actor) UpdateRoutesForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- func (actor Actor) UpdateWebProcessForApplication(pushPlan PushPlan, eventStream chan<- Event, progressBar ProgressBar) (PushPlan, Warnings, error)
- type Application
- type ChangeApplicationFunc
- type Event
- type FlagOverrides
- type ManifestParser
- type ProgressBar
- type PushPlan
- func SetupApplicationForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupBitsPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupDockerImageCredentialsForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupNoStartForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupScaleWebProcessForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupSkipRouteCreationForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- func SetupUpdateWebProcessForPushPlan(pushPlan PushPlan, overrides FlagOverrides, ...) (PushPlan, error)
- 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+)?$"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { V2Actor V2Actor V7Actor V7Actor PushPlanFuncs []UpdatePushPlanFunc ChangeApplicationFuncs []ChangeApplicationFunc StartFuncs []ChangeApplicationFunc NoStartFuncs []ChangeApplicationFunc // contains filtered or unexported fields }
Actor handles all business logic for Cloud Controller v2 operations.
func NewActor ¶
func NewActor(v2Actor V2Actor, v3Actor V7Actor, sharedActor SharedActor) *Actor
NewActor returns a new actor.
func (Actor) CreateAndMapDefaultApplicationRoute ¶
func (Actor) CreateAndReturnArchivePath ¶
func (actor Actor) CreateAndReturnArchivePath(plan PushPlan, unmatchedResources []sharedaction.V3Resource) (string, error)
func (Actor) CreateAndUploadApplicationBits ¶
func (Actor) CreateBitsPackageForApplication ¶
func (Actor) CreateDockerPackageForApplication ¶
func (Actor) CreatePushPlans ¶
func (actor Actor) CreatePushPlans(appNameArg string, spaceGUID string, orgGUID string, parser ManifestParser, overrides FlagOverrides) ([]PushPlan, 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) DefaultDomain ¶
DefaultDomain looks up the shared and then private domains and returns back the first one in the list as the default.
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) PrepareSpace ¶
func (Actor) ScaleWebProcessForApplication ¶
func (Actor) SetDropletForApplication ¶
func (Actor) SetupAllResourcesForPushPlan ¶
func (actor Actor) SetupAllResourcesForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func (Actor) StagePackageForApplication ¶
func (Actor) StopApplication ¶
func (Actor) UpdateApplication ¶
func (Actor) UpdateApplicationSettings ¶
UpdateApplicationSettings syncs the Application state and GUID with the API.
func (Actor) UpdateRoutesForApplication ¶
func (Actor) UpdateWebProcessForApplication ¶
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<- Event, 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 ( ApplicationAlreadyExists Event = "App already exists" ApplyManifest Event = "Applying manifest" ApplyManifestComplete Event = "Applying manifest Complete" BoundRoutes Event = "bound routes" BoundServices Event = "bound services" ConfiguringServices Event = "configuring services" CreatedApplication Event = "created application" CreatedRoutes Event = "created routes" CreatingAndMappingRoutes Event = "creating and mapping routes" CreatingApplication Event = "creating application" CreatingArchive Event = "creating archive" CreatingPackage Event = "creating package" PollingBuild Event = "polling build" ReadingArchive Event = "reading archive" ResourceMatching Event = "resource matching" RetryUpload Event = "retry upload" ScaleWebProcess Event = "scaling the web process" ScaleWebProcessComplete Event = "scaling the web process complete" SetDockerImage Event = "setting docker properties" SetDockerImageComplete Event = "completed setting docker properties" SetDropletComplete Event = "set droplet complete" SetProcessConfiguration Event = "setting configuration on the process" SetProcessConfigurationComplete Event = "completed setting configuration on the process" SettingDroplet Event = "setting droplet" SettingUpApplication Event = "setting up application" SkippingApplicationCreation Event = "skipping creation" StagingComplete Event = "staging complete" StartingStaging Event = "starting staging" StoppingApplication Event = "stopping application" StoppingApplicationComplete Event = "stopping application complete" UnmappingRoutes Event = "unmapping routes" UpdatedApplication Event = "updated application" UploadDropletComplete Event = "upload droplet complete" UploadingApplication Event = "uploading application" UploadingApplicationWithArchive Event = "uploading application with archive" UploadingDroplet Event = "uploading droplet" UploadWithArchiveComplete Event = "upload complete" Complete Event = "complete" )
type FlagOverrides ¶
type FlagOverrides struct { Buildpacks []string Stack string Disk types.NullUint64 DockerImage string DockerPassword string DockerUsername string HealthCheckEndpoint string HealthCheckTimeout int64 HealthCheckType constant.HealthCheckType Instances types.NullInt Memory types.NullUint64 NoStart bool ProvidedAppPath string SkipRouteCreation bool StartCommand types.FilteredString }
type ManifestParser ¶
type ManifestParser interface { Apps(appName string) ([]manifestparser.Application, error) ContainsManifest() bool FullRawManifest() []byte RawAppManifest(appName string) ([]byte, error) }
type ProgressBar ¶
type PushPlan ¶
type PushPlan struct { SpaceGUID string OrgGUID string Application v7action.Application ApplicationNeedsUpdate bool NoStart bool NoRouteFlag bool SkipRouteCreation bool DockerImageCredentials v7action.DockerImageCredentials DockerImageCredentialsNeedsUpdate bool ScaleWebProcess v7action.Process ScaleWebProcessNeedsUpdate bool UpdateWebProcess v7action.Process UpdateWebProcessNeedsUpdate bool Manifest []byte Archive bool BitsPath string AllResources []sharedaction.V3Resource PackageGUID string DropletGUID string }
func SetupApplicationForPushPlan ¶
func SetupApplicationForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupBitsPathForPushPlan ¶
func SetupBitsPathForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupDockerImageCredentialsForPushPlan ¶
func SetupDockerImageCredentialsForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupNoStartForPushPlan ¶
func SetupNoStartForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupScaleWebProcessForPushPlan ¶
func SetupScaleWebProcessForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupSkipRouteCreationForPushPlan ¶
func SetupSkipRouteCreationForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
func SetupUpdateWebProcessForPushPlan ¶
func SetupUpdateWebProcessForPushPlan(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (PushPlan, error)
type SharedActor ¶
type SharedActor interface {}
type UpdatePushPlanFunc ¶
type UpdatePushPlanFunc func(pushPlan PushPlan, overrides FlagOverrides, manifestApp manifestparser.Application) (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 { CreateApplicationInSpace(app v7action.Application, spaceGUID string) (v7action.Application, v7action.Warnings, error) CreateBitsPackageByApplication(appGUID string) (v7action.Package, v7action.Warnings, error) CreateDockerPackageByApplication(appGUID string, dockerImageCredentials v7action.DockerImageCredentials) (v7action.Package, v7action.Warnings, error) GetApplicationByNameAndSpace(appName string, spaceGUID string) (v7action.Application, v7action.Warnings, error) GetApplicationsByNamesAndSpace(appNames []string, spaceGUID string) ([]v7action.Application, v7action.Warnings, error) PollBuild(buildGUID string, appName string) (v7action.Droplet, v7action.Warnings, error) PollPackage(pkg v7action.Package) (v7action.Package, v7action.Warnings, error) ResourceMatch(resources []sharedaction.V3Resource) ([]sharedaction.V3Resource, 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, noRouteFlag bool) (v7action.Warnings, error) StageApplicationPackage(pkgGUID string) (v7action.Build, v7action.Warnings, error) StopApplication(appGUID 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) }
Source Files ¶
- actor.go
- actualize.go
- application.go
- change_application_func.go
- create_bits_package_for_application.go
- create_docker_package_for_application.go
- create_push_plans.go
- domain.go
- event.go
- manifest_parser.go
- prepare_space.go
- progress_bar.go
- push_plan.go
- resource_match.go
- route.go
- scale_web_process_for_application.go
- set_droplet_for_application.go
- setup_all_resources_for_push_plan.go
- setup_application_for_push_plan.go
- setup_bits_path_for_push_plan.go
- setup_docker_image_credentials_for_push_plan.go
- setup_no_start_for_push_plan.go
- setup_scale_web_process_for_push_plan.go
- setup_skip_route_creation_for_push_plan.go
- setup_update_web_process_for_push_plan.go
- shared_actor.go
- stage_package_for_application.go
- stop_application.go
- update_application.go
- update_application_settings.go
- update_push_plan_func.go
- update_routes_for_application.go
- update_web_process_for_application.go
- v2_actor.go
- v7_actor.go