Skip to content

K8s tutorial: Clarify how status is set if no relation data #2095

@dwilding

Description

@dwilding

In Integrate your charm with PostgreSQL, the definition of fetch_postgres_relation_data has a comment that says:

[...] If no data is retrieved, the unit is set to waiting status and the program exits with a zero status code.

This is confusing for several reasons:

  • The method itself doesn't set the unit status. Instead, later in the doc we're adding a collect-status handler that sets waiting status.
  • Even in the collect-status handler, fetch_postgres_relation_data isn't called. Instead, both places use self.database.fetch_relation_data.
  • "The program exists with a zero status" is technically true but not very helpful. We don't usually think of charms as programs that exit with particular status codes.

Discussion in Matrix: https://matrix.to/#/!LhFxJIPEcCacgdMghH:ubuntu.com/$yreC1AD_wDNvYYL18CyzXL6UPOp1yeCbVV28BpiIswc

Metadata

Metadata

Assignees

Labels

26.04An item we hope to do in the 26.04 cycledocsImprovements or additions to documentationrainy daySmall items done in ~10% of each week's time

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions