MCPcopy
hub / github.com/cloudfoundry/cli / processEvent

Method processEvent

command/v7/push_command.go:685–760  ·  view source on GitHub ↗
(event v7pushaction.Event, appName string)

Source from the content-addressed store, hash-verified

683}
684
685func (cmd *PushCommand) processEvent(event v7pushaction.Event, appName string) error {
686 switch event {
687 case v7pushaction.CreatingArchive:
688 cmd.UI.DisplayText("Packaging files to upload...")
689 case v7pushaction.UploadingApplicationWithArchive:
690 cmd.UI.DisplayText("Uploading files...")
691 log.Debug("starting progress bar")
692 cmd.ProgressBar.Ready()
693 case v7pushaction.UploadingApplication:
694 cmd.UI.DisplayText("All files found in remote cache; nothing to upload.")
695 cmd.UI.DisplayText("Waiting for API to complete processing files...")
696 case v7pushaction.RetryUpload:
697 cmd.UI.DisplayText("Retrying upload due to an error...")
698 case v7pushaction.UploadWithArchiveComplete:
699 cmd.ProgressBar.Complete()
700 cmd.UI.DisplayNewline()
701 cmd.UI.DisplayText("Waiting for API to complete processing files...")
702 case v7pushaction.UploadingDroplet:
703 cmd.UI.DisplayText("Uploading droplet bits...")
704 cmd.ProgressBar.Ready()
705 case v7pushaction.UploadDropletComplete:
706 cmd.ProgressBar.Complete()
707 cmd.UI.DisplayNewline()
708 cmd.UI.DisplayText("Waiting for API to complete processing files...")
709 case v7pushaction.StoppingApplication:
710 cmd.UI.DisplayText("Stopping Application...")
711 case v7pushaction.StoppingApplicationComplete:
712 cmd.UI.DisplayText("Application Stopped")
713 case v7pushaction.ApplyManifest:
714 cmd.UI.DisplayText("Applying manifest...")
715 case v7pushaction.ApplyManifestComplete:
716 cmd.UI.DisplayText("Manifest applied")
717 case v7pushaction.StartingStaging:
718 cmd.UI.DisplayNewline()
719 cmd.UI.DisplayText("Staging app and tracing logs...")
720 logStream, errStream, cancelFunc, warnings, err := cmd.VersionActor.GetStreamingLogsForApplicationByNameAndSpace(appName, cmd.Config.TargetedSpace().GUID, cmd.LogCacheClient)
721 cmd.UI.DisplayWarnings(warnings)
722 if err != nil {
723 return err
724 }
725 if cmd.stopStreamingFunc != nil {
726 cmd.stopStreamingFunc()
727 }
728 cmd.stopStreamingFunc = cancelFunc
729 go cmd.getLogs(logStream, errStream)
730 case v7pushaction.StagingComplete:
731 if cmd.stopStreamingFunc != nil {
732 cmd.stopStreamingFunc()
733 cmd.stopStreamingFunc = nil
734 }
735 case v7pushaction.RestartingApplication:
736 cmd.UI.DisplayNewline()
737 cmd.UI.DisplayTextWithFlavor(
738 "Waiting for app {{.AppName}} to start...",
739 map[string]interface{}{
740 "AppName": appName,
741 },
742 )

Callers 1

eventStreamHandlerMethod · 0.95

Calls 9

getLogsMethod · 0.95
DisplayTextMethod · 0.65
ReadyMethod · 0.65
CompleteMethod · 0.65
DisplayNewlineMethod · 0.65
TargetedSpaceMethod · 0.65
DisplayWarningsMethod · 0.65
DisplayTextWithFlavorMethod · 0.65

Tested by

no test coverage detected