Skip to content

fix: grant access for observability model to other nodes#794

Merged
hemanthnakkina merged 1 commit into
canonical:mainfrom
himax16:fix/2041610
May 20, 2026
Merged

fix: grant access for observability model to other nodes#794
hemanthnakkina merged 1 commit into
canonical:mainfrom
himax16:fix/2041610

Conversation

@himax16
Copy link
Copy Markdown
Member

@himax16 himax16 commented May 7, 2026

When observability feature is enabled, other node in the cluster or any new node joining the cluster will not have access to the Juju model.

This PR fixes the issue by granting access to the Observability model for all nodes currently in the cluster and retroactively grating new node joining the cluster the access to all Juju models.

Closes-Bug: #2041610

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a cluster access gap when the observability feature is enabled by ensuring Juju model permissions are granted more broadly across nodes, including retroactively for existing nodes and for nodes joining later.

Changes:

  • Update sunbeam local add to grant the newly created Juju user access to all Juju models (based on juju models --all output).
  • Extend Observability feature post_enable() to grant all existing cluster nodes access to the Observability model.
  • Add unit tests covering dynamic model grants on node add and post-enable grant behavior for Observability.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sunbeam-python/sunbeam/provider/local/commands.py Builds grant steps for all Juju models when adding a node.
sunbeam-python/sunbeam/features/observability/feature.py Grants Observability model access to all existing cluster nodes during post_enable().
sunbeam-python/tests/unit/sunbeam/provider/local/test_commands.py New tests verifying model access is granted for all models on node add.
sunbeam-python/tests/unit/sunbeam/features/test_observability.py New tests verifying post-enable grant logic and failure tolerance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sunbeam-python/sunbeam/provider/local/commands.py Outdated
Comment on lines +886 to +889
# Grant all existing Juju users access to the observability model
client = deployment.get_client()
jhelper = JujuHelper(deployment.juju_controller)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed once #791 is merged.

Comment thread sunbeam-python/sunbeam/features/observability/feature.py Outdated
@himax16
Copy link
Copy Markdown
Member Author

himax16 commented May 8, 2026

Waiting for #791 to be merged

Closes-Bug: #2041610
Signed-off-by: Himawan Winarto <himawan.winarto@canonical.com>
@himax16 himax16 marked this pull request as ready for review May 14, 2026 10:41
@hemanthnakkina hemanthnakkina merged commit 77f223d into canonical:main May 20, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants