From 244232bb1a891c37f526cafdcc893633e3170325 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Wed, 22 Mar 2023 11:43:57 +0200 Subject: [PATCH] fix: ensure metadata and selector are available --- .../kubernetes/deployment/KubernetesCommonHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java index 38ec88c14d0cdd..b7e2057356bb00 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesCommonHelper.java @@ -41,11 +41,13 @@ import io.dekorate.kubernetes.decorator.AddInitContainerDecorator; import io.dekorate.kubernetes.decorator.AddLabelDecorator; import io.dekorate.kubernetes.decorator.AddLivenessProbeDecorator; +import io.dekorate.kubernetes.decorator.AddMetadataToTemplateDecorator; import io.dekorate.kubernetes.decorator.AddMountDecorator; import io.dekorate.kubernetes.decorator.AddPvcVolumeDecorator; import io.dekorate.kubernetes.decorator.AddReadinessProbeDecorator; import io.dekorate.kubernetes.decorator.AddRoleBindingResourceDecorator; import io.dekorate.kubernetes.decorator.AddSecretVolumeDecorator; +import io.dekorate.kubernetes.decorator.AddSelectorToDeploymentSpecDecorator; import io.dekorate.kubernetes.decorator.AddServiceAccountResourceDecorator; import io.dekorate.kubernetes.decorator.AddStartupProbeDecorator; import io.dekorate.kubernetes.decorator.ApplicationContainerDecorator; @@ -238,6 +240,10 @@ private static Collection createLabelDecorators(Optional labels) { List result = new ArrayList<>(); + + result.add(new DecoratorBuildItem(target, new AddMetadataToTemplateDecorator())); + result.add(new DecoratorBuildItem(target, new AddSelectorToDeploymentSpecDecorator())); + labels.forEach(l -> { result.add(new DecoratorBuildItem(l.getTarget(), new AddLabelDecorator(name, l.getKey(), l.getValue()))); @@ -809,4 +815,4 @@ private static Map verifyPorts(List ku } return result; } -} \ No newline at end of file +}