Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow differentiating V0 and V1 programmatically #125

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

saltiyazan
Copy link
Contributor

Description

Some requirers like Traefik need to support both V0 and V1, no to have two different relations for different implementations of the same interface we improve the library so the requirer can check if it is connecting to a provider that implements V0 or V1:

  • Adds the V1 postfix to the Object identifier in V1 of the lib so the objects for both V0 and V1 can be created for the same relation name with no conflicts.
  • Adds is_ready() functions to the require that allows the requirer to validate the relation data of the provide, if it passes the checks for V0 then the provider is implementing V0 if it passes the checks for V1 then the provider is implementing V1, then the requirer can run different code for different providers.

This will be used to address the comments in this PR in Traefik.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that validate the behaviour of the software.
  • I validated that new and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have bumped the version of any required library.

@saltiyazan saltiyazan marked this pull request as ready for review December 4, 2024 10:30
@saltiyazan saltiyazan requested a review from a team as a code owner December 4, 2024 10:30
@saltiyazan saltiyazan merged commit 555be30 into main Dec 5, 2024
10 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.

2 participants