README
¶
release
release is a tool designed to streamline the process of creating and releasing a new operator.
Installation
To install:
make hack/bin/release
[!TIP] Add
hack/binto yourPATHto allow running the tool usingreleasecommand.
Usage
To start, familiarize yourself with the tool
release --help
For more information on a specific command, see Commands section or use:
release <command> --help
Build and publish a release
To build and publish a vA.B.C release, it use the release build and release publish commands.
For more information, see release build and release publish sections.
Below will use the makefile target to demonstrate the usage (as expected to be run from the root of the repository).
![WARNING] This assumes user has made all the necessary changes to prepare for the release.
-
Build the operator image for version
vA.B.Cmake release VERSION=vA.B.C -
Publish the operator image to the container registry and create GitHub release. By default, it creates a draft release.
- Create GitHub release as draft
make release-publish VERSION=vA.B.CTo make the draft GitHub release public, either go to the Releases page and publish the draft release or run locally:
make release-github VERSION=vA.B.CThis uses the
release githubcommand under the hood. See release github section for more information.- Create GitHub release and make it public directly
make release-publish VERSION=vA.B.C DRAFT_GITHUB_RELEASE=false
Build and publish a hashrelease
This is similar to building and publishing a release, it uses the release build and release publish commands.
However, some additonal flags are used to provide more information on the Calico or Calico Enterprise version to be included in the hashrelease.
Unlike a release, a hashrelease is typically for either a Calico or Calico Enterprise version not both though it is possible to do both but not advised.
-
Given an operator development version
vA.B.C-0.dev-N-gHAAAAAAAAASH-
Build the hashrelease operator image for Calico vX.Y.Z-0.dev-N-gSHAAAAAAAAAA
make release HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-0.dev-N-gSHAAAAAAAAAA \ --calico-version vX.Y.Z-0.dev-N-gSHAAAAAAAAAA --calico-dir path/to/local/calico-repo # alternatively, using versions file # make release HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-0.dev-N-gSHAAAAAAAAAA \ # --calico-versions path/to/calico-versions.yaml -
Build the hashrelease operator image for Calico Enterprise vX.Y.Z-calient-0.dev-N-gSHAAAAAAAAAA
make release HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-calient-0.dev-N-gSHAAAAAAAAAA \ --enterprise-version vX.Y.Z-calient-0.dev-N-gSHAAAAAAAAAA --enterprise-dir path/to/local/enterprise-repo # alternatively, using versions file # make release HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-calient-0.dev-N-gSHAAAAAAAAAA \ # --enterprise-versions path/to/enterprise-versions.yaml
-
-
Publish the hashrelease operator image to the container registry.
- For Calico hashrelease
make release-publish HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-0.dev-N-gSHAAAAAAAAAA- For Calico Enterprise hashrelease
make release-publish HASHRELEASE=true VERSION=vA.B.C-0.dev-XXX-gYYYYYYYYYYYY-vX.Y.Z-calient-0.dev-N-gSHAAAAAAAAAA
Commands
release build
This command builds the operator image for a specific operator version.
To build the operator image, use the following command:
release build --version <operator version>
For hashrelease, use the --hashrelease flag and provide either the Calico or Calico Enterprise version or versions file.
When using Calico or/and Calico Enterprise version, the local directory of the respective repository must be provided.
When using versions file, provide the path to the local director of the respective repository if local changes are to be included;
otherwise, the latest commit for the respective
release build --version <operator version> --hashrelease \
[--calico-version <calico version> | --calico-versions <path to calico version file> |--enterprise-version <enterprise version> | --enterprise-versions <path to enterprise version file>] [--calico-dir <path to local calico repo> | --enterprise-dir <path to local enterprise repo>]
Examples
-
To build the operator image for operator version
v1.36.0release build --version v1.36.0 -
To build hashrelease operator image for Calico v3.30
-
Using Calico versions file
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5 \ --calico-versions path/to/calico-versions.yaml -
Specifying version directly
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5 \ --calico-version v3.30.0-0.dev-338-gca80474016a5 --calico-dir path/to/local/calico-repo
-
-
To build hashrelease operator image for Calico Enterprise v3.22
-
Using Enterprise versions file
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.22.0-calient-0.dev-100-gabcdef123456 \ --enterprise-versions path/to/enterprise-versions.yaml -
Specifying version directly
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.22.0-calient-0.dev-100-gabcdef123456 \ --enterprise-version v3.22.0-calient-0.dev-100-gabcdef123456 --enterprise-dir path/to/local/enterprise-repo
-
-
Not typically recommended, but to build hashrelease operator image for both Calico v3.30 and Calico Enterprise v3.22
-
Using versions file
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5-v3.22.0-calient-0.dev-100-gabcdef123456 \ --calico-versions path/to/calico-versions.yaml --enterprise-versions path/to/enterprise-versions.yaml -
Specifying versions directly
release build --hashrelease --version v1.36.0-0.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5-v3.22.0-calient-0.dev-100-gabcdef123456 \ --calico-version v3.30.0-0.dev-338-gca80474016a5 --calico-dir path/to/local/calico-repo \ --enterprise-version v3.22.0-calient-0.dev-100-gabcdef123456 --enterprise-dir path/to/local/enterprise-repo
-
release publish
This commands publishes the operator image for a specific operator version to a container registry.
release publish --version <operator version>
For hashrelease, use the --hashrelease flag
release publish --version <operator version> --hashrelease
If this is a release version (i.e. vX.Y.Z) and the --create-github-release flag is set to true,
it creates a draft release on the Releases page.
Examples
-
To publish the operator version
v1.36.0release publish --version v1.36.0 -
To publish the hashrelease operator image for operator v1.36 with Calico v3.30
release publish --version v1.36.0-0.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5 --hashrelease -
To publish the operator version
v1.36.0and create a GitHub releaserelease publish --version v1.36.0 --create-github-release
release prep
This command prepares the repo for a new release. This typically involves updating the versions config files, image registry for the product if applicable, and re-generating any generated files. All the changes are committed to a new branch, which is then pushed to the remote and a pull request is created against the release branch for review. Finally, it manages the milestones on GitHub for the release stream associated with the new release, which involves creating a new milestone for the next patch version and closing the current milestone for the release version. All open issues and pull requests associated with the current milestone are moved to the new milestone.
[!IMPORTANT] At least one of Calico or Calico Enterprise version must be specified. If both are specified, the versions files for both products are updated.
To prepare for a new release, use the following command:
release prep --version <new operator version> [--calico-version <calico version> |
--enterprise-version <calico enterprise version>]
If the --local flag is specified, none of the remote changes will be made i.e.
no branch in the remote repo and no pull request will be created. Also milestones will not be modified on GitHub.
Examples
-
To prepare for a new release
v1.36.0with Calico versionv3.30.0release prep --version v1.36.0 --calico-version v3.30.0 -
To prepare for a new release
v1.36.0with Calico Enterprise versionv3.20.0-1.0release prep --version v1.36.0 --enterprise-version v3.20.0-1.0 -
To prepare for a new release
v1.36.0with Calico versionv3.30.0and Calico Enterprise versionv3.20.0-1.0using local changes onlyrelease prep --version v1.36.0 --calico-version v3.30.0 --enterprise-version v3.20.0-1.0 --local
release notes
This command generates release notes for a specific operator version. To generate release notes, use the following command:
release notes --version <operator version>
The generated releases notes are saved in a markdown file named <operator version>-release-notes.md.
The release notes includes the Calico and Calico Enterprise versions included in the operator version.
By default, this is gotten from the versions files corresponding to the product in config/ directory
in the commit with the tag matching the operator version.
To get the versions file from the local working directory instead of the tagged commit, use the --local flag.
Examples
-
To generate release notes for operator version
v1.36.0from the tagged commitrelease notes --version v1.36.0 -
To generate release notes for operator version
v1.36.0using the local versions filesrelease notes --version v1.36.0 --local
release github
This command creates or updates a GitHub release for a specific operator version. To create or update a GitHub release, use the following command:
release github --version <operator version>
By default, the GitHub release is not created in draft mode. To create a draft release, use the --draft flag.
Examples
-
To create or update a GitHub release for operator version
v1.36.0release github --version v1.36.0 -
To create or update a draft GitHub release for operator version
v1.36.0release github --version v1.36.0 --draft
release from
This command creates a new operator version based on a previous operator version.
The base operator version must reference either a tag or commit hash in tigera/operator.
The new operator version will be built from the current codebase
with updates made to the image list based on the changes passed in.
release from --base-version <previous operator version> --version <version to release> \
[--except-calico | --except-calico-enterprise] <image>:<image version>
[!IMPORTANT] To publish the newly created operator, use the
--publishflag
--publishwill push the operator image to remote repository and ONLY create a draft release on the Releases page for release versions (i.e. vX.Y.Z)
Examples
-
To create a new operator with an updated
typhafor Calico to a custom registry locallyrelease from --base-version v1.36.0-1.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5 --version v1.36.0-mod-typha \ --except-calico typha:v3.30.0-0.dev-353-ge0bc56c0d646 --registry quay.io --image my-namespace/tigera-operator -
To create a new operator with an updated
typhafor Calico to a custom registryrelease from --base-version v1.36.0-1.dev-259-g25c811f78fbd-v3.30.0-0.dev-338-gca80474016a5 --version v1.36.0-mod-typha \ --except-calico typha:v3.30.0-0.dev-353-ge0bc56c0d646 --registry quay.io --image my-namespace/tigera-operator --publish -
To create a new operator release
v1.36.3that has almost all the same images asv1.36.2with the exception of Enterpriselinseedcomponent usingv3.20.0-2.2locally.[!WARNING] This assumes that user has push access to
tigera/operatorrelease from --base-version v1.36.2 --version v1.36.3 \ --except-calico-enterprise linseed:v3.20.0-2.2 -
To create a new operator release
v1.36.3that has almost all the same images asv1.36.2with the exception of Enterpriselinseedcomponent usingv3.20.0-2.2.[!WARNING] This assumes that user has push access to
tigera/operatorandquay.io/tigera/operatorrelease from --base-version v1.36.2 --version v1.36.3 \ --except-calico-enterprise linseed:v3.20.0-2.2 --publish
Documentation
¶
There is no documentation for this package.