From 8c7e7d1f9366bf3a6626cc7998a726decef6699a Mon Sep 17 00:00:00 2001 From: Levi Ramsey Date: Thu, 25 Jul 2024 11:40:37 -0400 Subject: [PATCH] refine the default --- .../kubernetes/KubernetesJsonSupport.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesJsonSupport.scala b/rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesJsonSupport.scala index 64fdbcc1..5db61bbe 100644 --- a/rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesJsonSupport.scala +++ b/rolling-update-kubernetes/src/main/scala/akka/rollingupdate/kubernetes/KubernetesJsonSupport.scala @@ -78,9 +78,7 @@ case class Spec(pods: immutable.Seq[PodCost]) */ @InternalApi trait KubernetesJsonSupport extends SprayJsonSupport with DefaultJsonProtocol { - val _revisionAnnotations: HasRevisionAnnotations = new HasRevisionAnnotations { - def revisionAnnotations = Seq("deployment.kubernetes.io/revision") - } + val _revisionAnnotations: HasRevisionAnnotations = KubernetesJsonSupport.defaultRevisionAnnotations // If adding more formats here, remember to also add in META-INF/native-image reflect config implicit val metadataFormat: JsonFormat[Metadata] = jsonFormat2(Metadata.apply) @@ -125,3 +123,9 @@ trait KubernetesJsonSupport extends SprayJsonSupport with DefaultJsonProtocol { implicit val replicaSetMedatataFormat: JsonFormat[ReplicaSetMetadata] = jsonFormat1(ReplicaSetMetadata.apply) implicit val podReplicaSetFormat: RootJsonFormat[ReplicaSet] = jsonFormat1(ReplicaSet.apply) } + +private[kubernetes] object KubernetesJsonSupport { + val defaultRevisionAnnotations: HasRevisionAnnotations = new HasRevisionAnnotations { + val revisionAnnotations = Seq("deployment.kubernetes.io/revision") + } +}