pjfanning opened a new pull request, #784: URL: https://github.com/apache/pekko-management/pull/784
This PR ports [akka/akka-management#1143](https://github.com/akka/akka-management/pull/1143) to pekko, adapting all `akka` references to `pekko`. Now available under Apache License version 2.0. ## Summary Adds a new `AppVersionRevision` extension that reads the Kubernetes deployment revision annotation (`deployment.kubernetes.io/revision`) from the Kubernetes API and uses it to set `pekko.cluster.app-version`. This solves the problem where `kubectl rollout undo` deploys a previous ReplicaSet that contains a stale `pekko.cluster.app-version` config value — since the Kubernetes revision always increases (even during rollback), using it as the app version is safe. ## Changes ### New functionality - **`AppVersionRevision.scala`** — new extension that starts the revision-reading process and calls `Cluster.setAppVersionLater()` - **`KubernetesApi.scala`** — added `readRevision(): Future[String]` to the trait; added exception types `ReadRevisionException`, `GetPodException`, `ReplicaSetException` - **`KubernetesApiImpl.scala`** — implemented `readRevision()`, `getPod()`, `getReplicaSet()` with retry logic - **`KubernetesJsonSupport.scala`** — added JSON model types: `Pod`, `PodMetadata`, `PodOwnerRef`, `ReplicaSet`, `ReplicaSetMetadata`, `ReplicaAnnotation` ### Tests - `AppVersionRevisionSpec.scala` — unit tests using WireMock - `AppVersionRevisionJavaCompileTest.java` — Java compile test - `AppVersionRevisionCompileOnly.scala` / `AppVersionRevisionCompileOnly.java` — doc code snippets - `PodDeletionCostAnnotatorCrSpec.scala` — added `readRevision()` override to stub ### Cleanup - **`ClusterBootstrap.scala`** — refactored to use `AtomicBoolean` instead of `AtomicReference[BootstrapStep]`, removing the `Internal` object - MiMA filter added for the `ClusterBootstrap.Internal` class removal ### Integration tests - `pekko-cluster-app-value-revision.yml` — Kubernetes deployment YAML - `test-app-version-revision.sh` — test entrypoint script - `app-version-revision-kubernetes-test.sh` — full integration test (tests revision increment on update and rollback) ### CI - `.github/workflows/integration-tests-app-version-revision.yml` — new workflow using same action versions as existing workflows in this repo ### Documentation - `rolling-updates.md` — new section documenting `AppVersionRevision` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
