This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
main/scala/akka/cli/cloudflow/execution
test/scala/akka/cli/cloudflow/execution Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ object CloudflowConfig {
213
213
}
214
214
}
215
215
216
+ implicit val labelValueWriter = ConfigWriter .fromFunction[LabelValue ] { label : LabelValue =>
217
+ ConfigValueFactory .fromAnyRef(label.value)
218
+ }
219
+
216
220
// LabelKey
217
221
218
222
final case class LabelKey (key : String )
Original file line number Diff line number Diff line change @@ -718,6 +718,29 @@ class CloudflowConfigSpec extends AnyFlatSpec with Matchers with OptionValues wi
718
718
res.failure.exception.getMessage.contains(LabelsNotAllowedOnPod ) shouldBe true
719
719
}
720
720
721
+ it should " write label values as plain strings" in {
722
+ // Arrange
723
+ val config = s """ cloudflow {
724
+ | streamlets {
725
+ | flink {
726
+ | kubernetes.pods {
727
+ | pod {
728
+ | labels: {
729
+ | mykey = myvalue
730
+ | }
731
+ | }
732
+ | }
733
+ | }
734
+ | }
735
+ |} """ .stripMargin
736
+
737
+ // Act
738
+ val res = ConfigFactory .empty().withFallback(writeConfig(loadAndValidate(ConfigSource .string(config)).get))
739
+
740
+ // Assert
741
+ res.getString(" cloudflow.streamlets.flink.kubernetes.pods.pod.labels.mykey" ) shouldBe " myvalue"
742
+ }
743
+
721
744
it should " generate proper default mounts" in {
722
745
// Arrange
723
746
val crFile = new File (" ./cloudflow-cli/src/test/resources/swiss-knife.json" )
You can’t perform that action at this time.
0 commit comments