Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ object CloudflowConfig {
}
}

implicit val labelValueWriter = ConfigWriter.fromFunction[LabelValue] { label: LabelValue =>
ConfigValueFactory.fromAnyRef(label.value)
}

// LabelKey

final case class LabelKey(key: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,29 @@ class CloudflowConfigSpec extends AnyFlatSpec with Matchers with OptionValues wi
res.failure.exception.getMessage.contains(LabelsNotAllowedOnPod) shouldBe true
}

it should "write label values as plain strings" in {
// Arrange
val config = s"""cloudflow {
| streamlets {
| flink {
| kubernetes.pods {
| pod {
| labels: {
| mykey = myvalue
| }
| }
| }
| }
| }
|}""".stripMargin

// Act
val res = ConfigFactory.empty().withFallback(writeConfig(loadAndValidate(ConfigSource.string(config)).get))

// Assert
res.getString("cloudflow.streamlets.flink.kubernetes.pods.pod.labels.mykey") shouldBe "myvalue"
}

it should "generate proper default mounts" in {
// Arrange
val crFile = new File("./cloudflow-cli/src/test/resources/swiss-knife.json")
Expand Down