Skip to content

Bump to ops 2.10 and remove workaround for excluding breaking apps from relation-broken events #177

Description

@ca-scribner

Why it needs to get done

The kubeflow_dashboard libraryu has the following workaround:

def get_name_of_breaking_app(relation_name: str) -> Optional[str]:
"""Returns breaking app name if called during RELATION_NAME-relation-broken and the breaking app name is available. # noqa
Else, returns None.
Relation type and app name are inferred from juju environment variables.
"""
if not os.environ.get("JUJU_REMOTE_APP", None):
# No remote app is defined
return None
if not os.environ.get("JUJU_RELATION", None) == relation_name:
# Not this relation
return None
if not os.environ.get("JUJU_HOOK_NAME", None) == f"{relation_name}-relation-broken":
# Not the relation-broken event
return None
return os.environ.get("JUJU_REMOTE_APP", None)

This should not be needed as of ops 2.10.0 release. We should test whether 2.10.0 successfully fixes this issue, and if so remove the current workaround.

What needs to get done

  1. test whether ops 2.10.0 fixes the relation-broken handling issue
  2. remove the workaround
  3. update any charms that use this library to remove the workaround from all charms

When is the task considered done

  1. publish an updated charm library with the hack removed
  2. update all charms that use the library (or create separate issues for them to be updated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Labeled

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions