Skip to main content
The timoni bundle update command keeps the module references of a bundle up to date. It lists the versions published in the module repositories, selects the version matching the update policy declared on each reference, and rewrites the version and digest fields in the bundle CUE files.

Example

The update policy is declared with the @timoni(update:...) attribute on the module.version field of an instance:
Running the update command rewrites the references in place:
The files are formatted with timoni fmt when written, and comments and attributes are preserved. When all the references are up to date, the command prints all module references are up to date and leaves the files untouched. To print the available updates without modifying the files, use the --dry-run flag.

Update policies

The @timoni(update:...) attribute accepts one of the following policies: The semver constraint accepts wildcards, ranges and the tilde and caret operators, for example 8.x, 6.14.x, >=1.0.0 <2.0.0, ~1.2, ^1.2.3, or * for the newest version. The version is never downgraded. When no published version matching the constraint is newer than the current one, the version is kept and only a pinned digest is refreshed. When no published version matches the constraint at all, the command fails. Pre-release versions, for example 1.21.1-4, are selected only when the current version is itself a pre-release, and the constraint is matched against the version without the pre-release suffix. A reference set to a release version never moves to a pre-release.

Update level

Module references without an update attribute are left untouched by default. The --level flag applies an update policy to them:
The patch and minor levels require the current version to be a semantic version. References set to latest or to another tag are skipped, unless the level is major, which selects the newest version regardless of the current one.

Digest pinning

When an instance pins the module digest next to the version, the digest is updated together with the version, and refreshed when the tag is overwritten while the version stays the same. An instance that pins the digest without setting the version follows the latest tag. Its digest is refreshed with the @timoni(update:digest) attribute declared on the digest field, or with any --level other than none:

Shared versions

A version defined once and referenced by several instances is updated in one place, and all the instances referencing it are reported together. The update attribute is declared on the shared field:
Instances sharing a version must reference the same module repository and declare the same update policy, otherwise the command fails.

Skipped references

The command updates only the module references defined by string literals in CUE files, and reports the instances it skips along with the reason:
  • the module URL is not an OCI URL, e.g. a file:// local module
  • the module URL, version, or digest is set from a runtime value
  • the version is not a string literal, e.g. an interpolation or an expression
  • the version is defined in a YAML or JSON file, or in a file outside the CUE module
  • the version is defined in multiple places
  • the update policy is none, or the --level cannot apply to the current version

Validation

After the update, validate the bundle definition with timoni bundle vet, then build the instances with timoni bundle build to validate the values against the new module versions:

Continuous updates with GitHub Actions

To open a pull request with the updates on a schedule, run the update command in CI and commit the modified files, with the updated module references listed in the commit message and in the pull request body:
When the module repositories require authentication, pass the registry credentials with the --creds flag or log in with docker login before running the command.