Skip to content

Wrong package state calculation for aborted deployments #2975

Open
@philippthun

Description

@philippthun

Issue

Aborting a cf push results in wrong package_state being calculated.

Steps to Reproduce

  • push a simple app (e.g. [1])
  • re-push and abort (CTRL+C) during staging phase (Staging app and tracing logs...)

Expected result

  • cf curl "/v2/apps/:guid" shows "package_state": "STAGED"

Current result

  • cf curl "/v2/apps/:guid" shows "package_state": "PENDING"

Context

The package_state method in ProcessModel [2] uses the PackageStateCalculator [3] which assumes that for a STAGED package the desired droplet must equal the latest droplet [4]; for an aborted push this assumption is wrong.

[1] https://github.com/cloudfoundry-samples/test-app
[2]

def package_state
calculator = PackageStateCalculator.new(self)
calculator.calculate
end

[3] https://github.com/cloudfoundry/cloud_controller_ng/blob/main/app/models/runtime/helpers/package_state_calculator.rb
[4]
@latest_droplet == @desired_droplet && !newer_package_than_droplet

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions