Skip to content

Commit

Permalink
fix: workaround failure when setting QUARKUS_CONTAINER_IMAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Jul 15, 2022
1 parent f1565c1 commit c470877
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ kubernetesYml.withInputStream { stream ->
KubernetesList list = Serialization.unmarshalAsList(stream)
assert list != null

//Most probably this (the handling of QUARKUS_CONTAINER_IMAGE_TAG) is something that we need to change, but until then this is needed.
String version = System.getenv("QUARKUS_CONTAINER_IMAGE_TAG") != null ? System.getenv("QUARKUS_CONTAINER_IMAGE_TAG") : "0.1-SNAPSHOT"

Deployment deployment = list.items.find{r -> r.kind == "Deployment" && r.metadata.name == "kubernetes-with-existing-selectorless-manifest"}
assert deployment != null
assert deployment.metadata.labels.get("app.kubernetes.io/name") == "kubernetes-with-existing-selectorless-manifest"
assert deployment.metadata.labels.get("app.kubernetes.io/version") == "0.1-SNAPSHOT"
assert deployment.metadata.labels.get("app.kubernetes.io/version") == version
assert deployment.spec.replicas == 3

assert deployment.spec.selector.matchLabels.get("app.kubernetes.io/name") == "kubernetes-with-existing-selectorless-manifest"
assert deployment.spec.selector.matchLabels.get("app.kubernetes.io/version") == "0.1-SNAPSHOT"
assert deployment.spec.selector.matchLabels.get("app.kubernetes.io/version") == version
}

0 comments on commit c470877

Please sign in to comment.