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

Add supports_open_port_on_k8s to JujuVersion #965

Merged
merged 5 commits into from
Jul 11, 2023
Merged

Add supports_open_port_on_k8s to JujuVersion #965

merged 5 commits into from
Jul 11, 2023

Conversation

carlcsaposs-canonical
Copy link
Contributor

open-port is not supported before Juju 3.0.3 on Kubernetes

Context: https://chat.charmhub.io/charmhub/pl/91t6ip37ybncuqe11eudfx38xw

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Thanks!

It's annoying we have some methods and some properties on this object -- but I think that was my fault when we introduced has_secrets as a property (and all the others were methods). Now that we have both, I think properties is the simpler way forward.

@benhoyt benhoyt requested a review from jameinel July 6, 2023 00:49
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

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

Approved, but I'd like us to think about the naming a bit.

@@ -123,3 +123,9 @@ def has_secrets(self) -> bool:
# * In 3.0.3, a bug with observer labels was fixed (juju/juju#14916)
# TODO(benhoyt): update to 3.0.3+ once shipped (for juju/juju#14916 fix)
return (self.major, self.minor, self.patch) >= (3, 0, 2)
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing you want to set this to 3,0,3 given the associated comment. (Not necessarily in this PR, but looks like a TODO that we forgot to follow up on)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fixed in #967. Is it kosher to remove the fallback now that 3.0.3 has been out for a long time? get_secret will fail if some people are still running 3.0.2, but that seems unlikely, and if it happens, we can just tell people "please upgrade to 3.0.3 or a later 3.x version". Do you know what we normally do in cases like this?

Copy link
Member

Choose a reason for hiding this comment

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

I would mark it clearly in the release notes associated with that version of python-libjuju.

All of the major places that are running 3.x are running 3.1, neither 3.0.2 or 3.0.3 are "supported" by the Juju team at this point.
But if you make it clear, then a charm author can decide if they want to specifically support 3.0.2 for their charm. (I think it is fine, IMO, this is pretty minor.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would mark it clearly in the release notes associated with that version of python-libjuju.

Thanks. I presume you mean "that version of ops"?

ops/jujuversion.py Show resolved Hide resolved
@@ -123,3 +123,9 @@ def has_secrets(self) -> bool:
# * In 3.0.3, a bug with observer labels was fixed (juju/juju#14916)
# TODO(benhoyt): update to 3.0.3+ once shipped (for juju/juju#14916 fix)
return (self.major, self.minor, self.patch) >= (3, 0, 2)
Copy link
Member

Choose a reason for hiding this comment

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

I would mark it clearly in the release notes associated with that version of python-libjuju.

All of the major places that are running 3.x are running 3.1, neither 3.0.2 or 3.0.3 are "supported" by the Juju team at this point.
But if you make it clear, then a charm author can decide if they want to specifically support 3.0.2 for their charm. (I think it is fine, IMO, this is pretty minor.)

ops/jujuversion.py Show resolved Hide resolved
@benhoyt benhoyt merged commit 31bee5e into canonical:main Jul 11, 2023
@benhoyt benhoyt changed the title Add has_open_port_k8s to JujuVersion Add supports_open_port_on_k8s to JujuVersion Jul 11, 2023
@benhoyt
Copy link
Collaborator

benhoyt commented Jul 11, 2023

Merged. Thanks @carlcsaposs-canonical!

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