From b082aab098bfc3502dddab0935327b6a8d95d659 Mon Sep 17 00:00:00 2001 From: Amirouche Date: Fri, 15 Mar 2024 15:57:57 +0100 Subject: [PATCH] Check if the fragment doesnot already have a name --- .../eclipse/jkube/enricher/generic/NameEnricher.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/NameEnricher.java b/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/NameEnricher.java index b371b43ed8..b124e862b9 100644 --- a/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/NameEnricher.java +++ b/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/NameEnricher.java @@ -54,10 +54,12 @@ public void create(PlatformMode platformMode, KubernetesListBuilder builder) { builder.accept(new TypedVisitor() { @Override public void visit(ObjectMetaBuilder resource) { - if (StringUtils.isNotBlank(configuredName)) { - resource.withName(configuredName); - } else if (StringUtils.isBlank(resource.getName())) { - resource.withName(defaultName); + if(StringUtils.isBlank(resource.getName())) { + if (StringUtils.isNotBlank(configuredName)) { + resource.withName(configuredName); + } else { + resource.withName(defaultName); + } } } });