Policies can be added by creating a new folder under updatecli/policies directory.
The subfolder path will be used as the policy name.
For example if we want to create a policy named autodiscovery/golang, we need to create a folder named updatecli/policies/autodiscovery/golang.
This policy will be named ghcr.io/updatecli/policies/autodiscovery/golang and will be published on ghcr.io docker registry.
The policy folder must contain:
Policy.yamlfile which contains the policy metadata.updatecli.ddirectory which contains the policy configuration files.README.mdfile which contains the policy documentation.CHANGELOG.mdfile which contains the policy changelog.values.yamlfile which contains the default values for the policy.
Policy.yaml
The Policy.yaml file must contain at least the following fields:
url: <link to this git repository>
documentation: <link to the policy documentation>
source: <link to this policy code>
version: <policy version>
description: <policy description with maximum 512 characters>Version
The version must be a valid semantic version. For example 1.0.0 or 1.0.0-beta.1
The version will be used as the "tag" for the policy such as ghcr.io/updatecli/policies/autodiscovery/golang:1.0.0
Any change to the policy code must be reflected by a new version. Policies are automatically published on ghcr.io if the version is updated.
When submitting a new feature, bug fix, or enhancement to an existing policy, you must update both:
Policy.yaml: bump theversionfield following semantic versioning:- Patch (
x.y.Z): backwards-compatible bug fixes - Minor (
x.Y.0): new backwards-compatible features or enhancements - Major (
X.0.0): breaking changes
- Patch (
CHANGELOG.md: add a new section at the top for the new version describing what changed.
A specific policy under the updatecli folder:
# To validate the policy ironbank/templates
$ make validate-policy POLICY=policies/ironbank/templatesFor all the policies
# To run some linting validation
$ make test
# To run some e2e-testing
$ GITHUB_TOKEN=$(gh auth token) \
GITHUB_WORKSPACE=$(pwd) \
make e2e-testYou can run https://github.com/elastic/oblt-updatecli-policies/actions/workflows/e2e.yml through the UI.
However, it's recommended to close all the open PRs related to the e2e that were already open.