Skip to content

Rollback ignores version parameter #157

Description

@zacharyblasczyk

Description

In pkg/helm/chart.go:124-127, the Rollback(version int) method accepts a version parameter but never passes it to the Helm rollback action:

func (c *ActionableChart) Rollback(version int) error {
    client := action.NewRollback(c.config)
    return client.Run(c.releaseName)
}

This silently rolls back to the previous release rather than the specified version. If version-targeted rollbacks are ever needed, this will produce incorrect behavior.

Suggested fix

Set the version on the rollback client before running:

func (c *ActionableChart) Rollback(version int) error {
    client := action.NewRollback(c.config)
    client.Version = version
    return client.Run(c.releaseName)
}

Found during review of #147.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions