← Back to issue list

feat(templates): add workload module to Kubernetes and machine profiles

View original Github issue

Metadata

Project
charmcraft
Number
#2242
Type
pull request
State
merged
Author
dwilding
Labels
—
Created
Updated
Closed

Current evaluation

Merged as 040cce32, adding workload modules to Kubernetes and machine init profiles, plus updated init naming, CLI help, tests, and reference documentation.

Resolution: closed resolved

Reason: Pull request #2242 was approved and merged as commit 040cce32. It introduced workload-specific template modules and corresponding init logic, test coverage, CLI messaging, and documentation updates.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This PR update the `kubernetes` and `machine` profiles to include a standalone module for workload-specific logic. Other profiles are not changed in any way. In addition to the new workload module, the updated profiles have a bit more structure in `charm.py` to illustrate the basic flow of logic through the charm & workload module, and improved unit tests in `test_charm.py`. **This PR includes** - New/updated template files for the `kubernetes` and `machine` profiles. - Changes to `charmcraft/application/commands/init.py`, to determine the name of the workload module from the charm name (using `workload.py` if the charm has a generic name such as `charm` or `k8s-operator`). - Changes to `tests/integration/commands/test_init.py`, to test the updated functionality (with tests passing). - Updated help and output of `charmcraft init`, to make users aware of the workload module. - New/updated reference docs: - [`src/<workload>.py` file](https://canonical-charmcraft--2242.com.readthedocs.build/en/2242/reference/files/src-workload-py-file/) (new) - [`src/charm.py` file](https://canonical-charmcraft--2242.com.readthedocs.build/en/2242/reference/files/src-charm-py-file/) (updated) Hopefully it will be easy to follow my commits in sequence. I tried to make the changes in a logical step-by-step order.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as 040cce32, adding workload modules to Kubernetes and machine init profiles, plus updated init naming, CLI help, tests, and reference documentation.
stealth/space-bunny-alpha — closed resolved Merged #2242 as 040cce32, adding workload modules to Kubernetes and machine templates and updating init behavior, tests, CLI help, and reference docs.
qwen/qwen3.6-35b-a3b — — Merged. Adds a standalone workload module to Kubernetes and machine profiles, updates charmcraft init, refactors charm.py, and includes updated tests and docs. Approved by reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Introduces a standalone workload module for Kubernetes and machine profiles, updates charmcraft init to generate it, and adds corresponding tests and documentation.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.