canonical / canonical/knative-operators

Use the ErrorWithStatus+try & except pattern for layer errors

Open
#89 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Jinja
Stars
2
Forks
3
Avg merge
1d 9h
Merged PRs (30d)
2

Description

`_update_layer()` may catch a `ChangeError` emitted when doing a `container.add_layer()`. In `_update_layer()` we directly set the unit's status to Blocked based on this. This is different from our usual pattern of, when a helper has an opinion about a status to set, emitting an `ErrorWithStatus` which suggests the status of the charm.

We should also think about the type of status set here. Should it be Blocked, or Error?

See [this conversation[(https://github.com/canonical/knative-operators/pull/82#discussion_r1130979299) for more details

Contributor guide

Open the contributing guide

Research direction

Start by locating `_update_layer()` and tracing the `container.add_layer()` call, `ChangeError`, and existing `ErrorWithStatus` handling. Review the linked pull request conversation for the intended status semantics, then confirm that the helper follows the project’s try/except pattern and that the chosen charm status is covered by tests.

Written by the indexing model from the issue text.

Assessment

Domain
infrastructure
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.