Skip to content

feat: version lock/update of variant module #1

@mumoshu

Description

@mumoshu

b9f9c89 introduced version locking for files and binaries managed by a variant module.

For example, coreos variant module can be used to fetch the latest version number of coreos stable release channel and save it in variant.lock. The version number can be used for templating files and other useful things. Running mod up command re-fetches the version number and updates variant.lock.

However there's no way to update coreos variant module itself. This issue is to track the progress towards widening the version locking feature to support variant modules as well.

Perhaps this can be used only when a variant module is sourced from a git repo.

Assume you currently have a variant.mod like:

modules:
- source: github.com/variantdev/modules//coreos@variant.mod?ref=v1.0.0

Obviously v1.0.0 is a fixed value that can't be updated automatically.

Alter this to:

modules:
- source: github.com/variantdev/modules//coreos@variant.mod
  version: >= 1.0.0

On first mod up run, it fetches all the tags and branches in the github.com/variantdev/modules repositories and build a list of semantic versions.

It then uses the version range version: >= 1.0.0 to filter semantic versions larger than or equal to 1.0.0 and chooses the largest version number to be saved to variant.lock.

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