Skip to content

Commit

Permalink
fix: nil pointer after increase min version
Browse files Browse the repository at this point in the history
  • Loading branch information
nedimakar committed Mar 28, 2024
1 parent 0ba12ea commit 21012cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,8 @@
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"analytics": false
}
}
10 changes: 9 additions & 1 deletion src/jetstream/plugins/cfapppush/pushapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import (

"code.cloudfoundry.org/cli/actor/sharedaction"
"code.cloudfoundry.org/cli/actor/v7action"
"code.cloudfoundry.org/cli/actor/v7pushaction"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccversion"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/clock"

"code.cloudfoundry.org/cli/util/configv3"
"code.cloudfoundry.org/cli/util/manifestparser"
"code.cloudfoundry.org/cli/util/progressbar"
"code.cloudfoundry.org/cli/util/ui"
"github.com/gorilla/websocket"
Expand Down Expand Up @@ -223,6 +225,8 @@ func (c *CFPushApp) Init(appDir string, manifestPath string, overrides CFPushApp

// Manifest path
c.pushCommand.PathToManifest = flag.ManifestPathWithExistenceCheck(manifestPath)
c.pushCommand.ManifestLocator = manifestparser.NewLocator()
c.pushCommand.ManifestParser = manifestparser.ManifestParser{}

return nil
}
Expand All @@ -231,6 +235,8 @@ func (c *CFPushApp) Init(appDir string, manifestPath string, overrides CFPushApp
func (c *CFPushApp) setConfig(config *configv3.Config) error {
config.SetOrganizationInformation(c.config.OrgGUID, c.config.OrgName)
config.SetSpaceInformation(c.config.SpaceGUID, c.config.SpaceName, false)
c.pushCommand.VersionActor = c.pushCommand.Actor
c.pushCommand.PushActor = v7pushaction.NewActor(c.pushCommand.Actor, sharedaction.NewActor(config))
return nil
}

Expand Down Expand Up @@ -276,6 +282,7 @@ func (c *CFPushApp) Run(msgSender DeployAppMessageSender, clientWebsocket *webso

// Set to a null progress bar
c.pushCommand.ProgressBar = &cfPushProgressBar{}
c.pushCommand.DiffDisplayer = shared.NewManifestDiffDisplayer(commandUI)

// Perform the push
args := make([]string, 0)
Expand All @@ -294,7 +301,7 @@ func (c *CFPushApp) setup(config command.Config, ui command.UI, msgSender Deploy
sharedActor := sharedaction.NewActor(config)
cmd.SharedActor = sharedActor

ccClient, uaaClient, routingClient, err := shared.GetNewClientsAndConnectToCF(config, ui, ccversion.MinSupportedClientVersionV8)
ccClient, uaaClient, routingClient, err := shared.GetNewClientsAndConnectToCF(config, ui, ccversion.MinSupportedV2ClientVersion)
if err != nil {
return err
}
Expand All @@ -313,6 +320,7 @@ func (c *CFPushApp) setup(config command.Config, ui command.UI, msgSender Deploy
return err
}

ccClientV3.Requester = ccClient.Requester
v7Actor := v7action.NewActor(ccClientV3, config, sharedActor, uaaClient, routingClient, clock.NewClock())

cmd.Actor = v7Actor
Expand Down

0 comments on commit 21012cc

Please sign in to comment.