Skip to content

Improve failure status message when attempting to upgrade across major versions or downgrade #538

@everettraven

Description

@everettraven

As part of #533 we highlight the new spec.upgradeConstraintPolicy behavior and how when it is set to Enforce semver is followed and upgrades across a major version are not able to be performed.

Stepping through the process, I found the status message that is displayed when attempting to do this is:

  - lastTransitionTime: "2023-11-13T14:43:09Z"
    message: 'constraints not satisfiable: coastal package uniqueness permits at most
      1 of coastal-coastal-coastal.v2.0.0, coastal-coastal-coastal.v1.1.0; installed
      package coastal is mandatory; installed package coastal requires at least one
      of coastal-coastal-coastal.v1.1.0; required package coastal is mandatory; required
      package coastal requires at least one of coastal-coastal-coastal.v2.0.0'
    observedGeneration: 4
    reason: ResolutionFailed
    status: "False"
    type: Resolved
  - lastTransitionTime: "2023-11-13T14:43:09Z"
    message: installation has not been attempted as resolution is unsatisfiable
    observedGeneration: 4
    reason: InstallationStatusUnknown
    status: Unknown
    type: Installed

(the inverse is displayed when attempting a downgrade)

While I could grok from installed package coastal requires at least one of coastal-coastal-coastal.v1.1.0 followed by required package coastal requires at least one of coastal-coastal-coastal.v2.0.0 that it was trying to inform me I could not upgrade across major versions I don't think this message is very user friendly. I'm not sure I would have easily discerned that this is saying "I can't upgrade across major versions" if I wasn't explicitly exercising this functionality.

If possible, I think we should try to improve this message and have it explicitly highlight that the resolution failure is because of major version boundaries or a downgrade is being attempted. If we want to keep the resolution failure message this verbose, that is fine by me but we should at least convey a more useful message in the Installed condition message.

Instead of installation has not been attempted as resolution is unsatisfiable I'm thinking something more along the lines of:

Installation has not been attempted as resolution is unsatisfiable. 
Attempting to { cross major version boundaries || downgrade } from vX.Y.Z to vX.Y.Z, which is not allowed when spec.upgradeConstraintPolicy=Enforce. 
To force this behavior, set spec.upgradeConstraintPolicy=Ignore. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions