Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/pull_request_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Applicable spec: <link>

<!-- The reason the change is needed -->

### Juju Events Changes
### Juju events changes

<!-- Any changes to the juju events being observed (newly added, significantly modified or deleted) -->

### Module Changes
### Module changes

<!-- Any high level changes to modules and why (Service, Observer, helper) -->

### Library Changes
### Library changes

<!-- Any changes to charm libraries -->

Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/integration_test.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/publish_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ jobs:
secrets: inherit
with:
channel: latest/edge
integration-test-workflow-file: test.yaml
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ jobs:
with:
self-hosted-runner: true
self-hosted-runner-label: "edge"
docs-checks:
uses: canonical/operator-workflows/.github/workflows/docs.yaml@main
secrets: inherit
integration-tests:
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
secrets: inherit
with:
self-hosted-runner: true
self-hosted-runner-label: "edge"
juju-channel: '3/stable'
provider: 'lxd'
7 changes: 5 additions & 2 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ header:
Copyright [year] [owner]
See LICENSE file for licensing details.
pattern: |
Copyright \d{4} Canonical Ltd.
See LICENSE file for licensing details.
Copyright \d{4} Canonical Ltd.
See LICENSE file for licensing details.
paths:
- '**'
paths-ignore:
Expand All @@ -23,4 +23,7 @@ header:
- 'trivy.yaml'
- 'pyproject.toml'
- 'zap_rules.tsv'
- 'lib/**'
- 'src/grafana_dashboards/**'
- 'src/prometheus_alert_rules/**'
comment: on-failure
11 changes: 11 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; Copyright 2025 Canonical Ltd.
; See LICENSE file for licensing details.

StylesPath = .vale/styles

Packages = https://github.com/canonical/platform-engineering-vale-package/releases/download/latest/pfe-vale.zip

Vocab = PFE, local

[*]
BasedOnStyles = PFE
6 changes: 6 additions & 0 deletions .vale/styles/config/vocabularies/local/accept.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
chrony
Chrony
chronyc
chronyd
PPMs
reachability
7 changes: 7 additions & 0 deletions .woke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

ignore_files:
# Ignore apt charm library as it uses non compliant terminology:
# man-in-the-middle.
Comment thread
yhaliaw marked this conversation as resolved.
- lib/charms/operator_libs_linux/v0/apt.py
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When contributing, you must abide by the
This project uses [semantic versioning](https://semver.org/).

Please ensure that any new feature, fix, or significant change is documented by
adding an entry to the [CHANGELOG.md](link-to-changelog) file.
adding an entry to the [CHANGELOG.md](./docs/changelog.md) file.

To learn more about changelog best practices, visit [Keep a Changelog](https://keepachangelog.com/).

Expand All @@ -43,7 +43,7 @@ notify in advance the people involved to avoid confusion;
also, reference the issue or bug number when you submit the changes.

- [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks)
our [GitHub repository](link-to-github-repo)
our [GitHub repository](https://github.com/canonical/chrony-client-operator)
and add the changes to your fork, properly structuring your commits,
providing detailed commit messages and signing your commits.
- Make sure the updated project builds and runs without warnings or errors;
Expand Down
77 changes: 24 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
<!--
Avoid using this README file for information that is maintained or published elsewhere, e.g.:
# Chrony client charm

* metadata.yaml > published on Charmhub
* documentation > published on (or linked to from) Charmhub
* detailed contribution guide > documentation or CONTRIBUTING.md
[![CharmHub Badge](https://charmhub.io/chrony-client/badge.svg)](https://charmhub.io/chrony-client)
[![Publish to edge](https://github.com/canonical/chrony-client-operator/actions/workflows/publish_charm.yaml/badge.svg)](https://github.com/canonical/chrony-client-operator/actions/workflows/publish_charm.yaml)
[![Promote charm](https://github.com/canonical/chrony-client-operator/actions/workflows/promote_charm.yaml/badge.svg)](https://github.com/canonical/chrony-client-operator/actions/workflows/promote_charm.yaml)
[![Discourse Status](https://img.shields.io/discourse/status?server=https%3A%2F%2Fdiscourse.charmhub.io&style=flat&label=CharmHub%20Discourse)](https://discourse.charmhub.io)

Use links instead.
-->
<!--
NOTE: This template has the documentation under the `docs-template` due with issues with discourse-gatekeeper. The `docs-template` directory must be changed to `docs` after using this template to ensure discourse-gatekeeper correctly identifies the documentation changes.
-->
# platform-engineering-charm-template
<!-- Use this space for badges -->
A [Juju](https://juju.is/) [subordinate charm](https://documentation.ubuntu.com/juju/latest/reference/charm/#subordinate)
that deploys and configures Chrony as an NTP client.

Describe your charm in 1-2 sentences. Include the software that the charm deploys (if applicable), and the substrate (VM/K8s).
Like any Juju charm, it supports one-line deployment, configuration,
integration, scaling, and more. Specifically, the Chrony client charm
can:

Like any Juju charm, this charm supports one-line deployment, configuration, integration, scaling, and more. For Charmed {Name}, this includes:
* list or summary of app-specific features
* Install Chrony as an NTP client replacing the system default NTP client
* Configure time sources
* Integrate with COS for time tracking status observability

For information about how to deploy, integrate, and manage this charm, see the Official [platform-engineering-charm-template Documentation](external link).
For information on deploying, integrating, and managing this charm, see
the official [Chrony Client documentation](https://charmhub.io/chrony-client).

## Get started
<!--If the charm already contains a relevant how-to guide or tutorial in its documentation,
use this section to link the documentation. You don’t need to duplicate documentation here.
If the tutorial is more complex than getting started, then provide brief descriptions of the
steps needed for the simplest possible deployment. Make sure to include software and hardware
prerequisites.

This section could be structured in the following way:

### Set up
<Steps for setting up the environment (e.g. via Multipass)>

### Deploy
<Steps for deploying the charm>

-->
To begin, refer to the [Getting Started](./docs/tutorial.md) tutorial
for step-by-step instructions.

### Basic operations
<!--Brief walkthrough of performing standard configurations or operations.
Expand All @@ -47,31 +34,15 @@ Use this section to link the Charmhub documentation for actions and configuratio
You may also want to link to the `charmcraft.yaml` file here.
-->

## (Optional) Integrations
<!-- Information about particularly relevant interfaces, endpoints or libraries related to the
charm. For example, peer relation endpoints required by other charms for integration.

Otherwise, include a link the Charmhub documentation on integrations.
-->

## Learn more
<!--
Provide a list of resources, including the official documentation, developer documentation,
an official website for the software and a troubleshooting guide. Note that this list is not
exhaustive or always relevant for every charm. If there is no official troubleshooting guide,
include a link to the relevant Matrix channel.
-->

* [Read more]() <!--Link to the charm's official documentation-->
* [Developer documentation]() <!--Link to any developer documentation-->
* [Official webpage]() <!--(Optional) Link to official upstream webpage/blog/marketing content-->
* [Troubleshooting]() <!--(Optional) Link to a page or section about troubleshooting/FAQ-->
* [Read more](https://charmhub.io/chrony-client)
* [Developer documentation](https://chrony-project.org/documentation.html)
* [Official webpage](https://chrony-project.org/)
* [Troubleshooting](https://matrix.to/#/#charmhub-charmdev:ubuntu.com)

## Project and community
* [Issues]() <!--Link to GitHub issues (if applicable)-->
* [Contributing]() <!--Link to any contribution guides-->
* [Matrix]() <!--Link to contact info (if applicable), e.g. Matrix channel-->
* [Launchpad]() <!--Link to Launchpad (if applicable)-->

## (Optional) Licensing and trademark
* [Issues](https://github.com/canonical/chrony-client-operator/issues)
* [Contributing](./CONTRIBUTING.md)
* [Matrix](https://matrix.to/#/#charmhub-charmdev:ubuntu.com)

113 changes: 60 additions & 53 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,72 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
# This file configures Charmcraft.
# See https://canonical-charmcraft.readthedocs-hosted.com/stable/howto/manage-charmcraft/
# for guidance.

type: charm
name: is-charms-template
title: Charm Template
summary: A very short one-line summary of the charm.
name: chrony-client
title: Chrony Client Charm
summary: Chrony NTP client charm.
links:
documentation: https://discourse.charmhub.io
issues: https://github.com/canonical/is-charms-template-repo/issues
source: https://github.com/canonical/is-charms-template-repo
issues: https://github.com/canonical/chrony-client-operator/issues
source: https://github.com/canonical/chrony-client-operator
contact: https://launchpad.net/~canonical-is-devops

description: |
A single sentence that says what the charm is, concisely and memorably.

A paragraph of one to three short sentences, that describe what the charm does.

A third paragraph that explains what need the charm meets.

Finally, a paragraph that describes whom the charm is useful for.

bases:
- build-on:
- name: ubuntu
channel: "22.04"
run-on:
- name: ubuntu
channel: "22.04"

# The containers and resources metadata apply to Kubernetes charms only.
# Remove them if not required.
A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators)
for deploying and managing the [Chrony](https://chrony-project.org) NTP server
in your systems.

This charm simplifies the configuration and maintenance of `chrony` as a
NTP client.

# Your workload’s containers.
containers:
httpbin:
resource: httpbin-image

# This field populates the Resources tab on Charmhub.
resources:
# An OCI image resource for each container listed above.
# You may remove this if your charm will run without a workload sidecar container.
httpbin-image:
type: oci-image
description: OCI image for httpbin
# The upstream-source field is ignored by Juju. It is included here as a reference
# so the integration testing suite knows which image to deploy during testing. This field
# is also used by the 'canonical/charming-actions' Github action for automated releasing.
upstream-source: kennethreitz/httpbin
type: charm
subordinate: true

# See https://canonical-charmcraft.readthedocs-hosted.com/stable/reference/files/config-yaml-file/
# for guidance.
config:
options:
# An example config option to customise the log level of the workload
log-level:
description: |
Configures the log level of gunicorn.

Acceptable values are: "info", "debug", "warning", "error" and "critical"
default: "info"
sources:
description: >-
Time sources for the Chrony server are specified as a comma-separated list of URLs.
Currently, the Chrony charm supports using only another NTP server as the time source.
The format for NTP source URLs is as follows: `ntp://host[:port][?options]`, where the options are the same as
Chrony pool configuration settings (https://chrony-project.org/doc/4.5/chrony.conf.html).
For NTP sources that support NTS, the URL format is: `nts://host[:nts-ke-port][?options]`.
The options for NTS URLs are the same as those for NTP sources.
Here are some examples of supported sources:
`ntp://ntp.example.com`
`ntp://ntp.example.com:1234`
`ntp://ntp.example.com?iburst=true&maxsources=2`
`nts://ntp.example.com`
type: string
default: |-
ntp://ntp.ubuntu.com?iburst=true&maxsources=4,
ntp://0.ubuntu.pool.ntp.org?iburst=true&maxsources=1,
ntp://1.ubuntu.pool.ntp.org?iburst=true&maxsources=1,
ntp://2.ubuntu.pool.ntp.org?iburst=true&maxsources=2

requires:
juju-info:
interface: juju-info
scope: container

provides:
cos-agent:
interface: cos_agent

platforms:
ubuntu@24.04:amd64:
ubuntu@22.04:amd64:
parts:
charm:
build-snaps:
- rustup
override-build: |
rustup default stable
craftctl default
build-packages:
- libffi-dev
- libssl-dev
- pkg-config
changelog:
source: ./docs
plugin: dump
stage:
- changelog.md
7 changes: 0 additions & 7 deletions docs-template/changelog.md

This file was deleted.

Loading
Loading