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: configurable choice of annotations for rolling update revision #1303

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

leviramsey
Copy link
Contributor

@leviramsey leviramsey commented Jul 25, 2024

References #1302

Adds a config setting akka.rollingupdate.kubernetes.revision-annotation to allow configurability (default is the prior behavior). From there it's just dealing with Spray JSON. Admittedly it's been a while (ever?) since I've done Spray JSON trickery, but (with apologies to Tolstoy) "all happy typeclass-and-AST JSON libraries are alike".

I don't have a k8s cluster handy to test, mind.

@@ -237,7 +237,7 @@ Java

#### Configuration

The following configuration is required, more details for each and additional configurations can be found in [reference.conf](https://github.com/akka/akka-management/blob/main/rolling-updates-kubernetes/src/main/resources/reference.conf):
The following configuration is required, more details for each and additional configurations can be found in [reference.conf](https://github.com/akka/akka-management/blob/main/rolling-update-kubernetes/src/main/resources/reference.conf):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how long the typo has been there...

I think the comment in reference.conf is sufficient documentation for a niche feature.

implicit val replicaAnnotationFormat: JsonFormat[ReplicaAnnotation] = jsonFormat1(ReplicaAnnotation.apply)
implicit val replicaAnnotationFormat: RootJsonFormat[ReplicaAnnotation] =
new RootJsonFormat[ReplicaAnnotation] {
// Not sure if we ever write this out, but if we do, this will let us write out exactly what we took in
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we add the "writes" part only then if really need?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then we can even further simplify the case class ReplicaAnnotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a JsonFormat so needs a writes. If we're going to implement it, we might as well implement it right

@johanandren johanandren merged commit 2540201 into akka:main Aug 1, 2024
14 checks passed
@leviramsey leviramsey deleted the configurable-k8s-annotations branch August 1, 2024 11:47
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.

4 participants