From 4baa2df03d77de461ab1e3dc76691d4615129520 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 24 Mar 2020 21:51:58 +0530 Subject: [PATCH] Fix NullPointerException in ConfigMapEnricher This also seems to be a sideeffect of sundrio configuration change, A user emailed about this problem. --- CHANGELOG.md | 1 + README.md | 7 +++++-- .../maven/enricher/standard/ConfigMapEnricher.java | 10 ++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e91f77e6..750a4d5300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Usage: ``` ### 4.5-SNAPSHOT +* Fix NullPointerException in ConfigMapEnricher ### 4.4.1 (2020-03-18) * Fix: JIB Assembly config doesn't work with any Archive mode diff --git a/README.md b/README.md index 99847dee81..6fa296634f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ -## fabric8-maven-plugin -> Deprecation Note: This project has been moved to https://github.com/eclipse/jkube . All new features would be implemented there and support for FMP would be eventually dropped. +# Deprecation Note: + +This project has been moved to https://github.com/eclipse/jkube . All new features would be implemented there and support for FMP would be eventually dropped. + +## fabric8-maven-plugin [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.fabric8/fabric8-maven-plugin/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/io.fabric8/fabric8-maven-plugin/) [![Circle CI](https://circleci.com/gh/fabric8io/fabric8-maven-plugin/tree/master.svg?style=shield)](https://circleci.com/gh/fabric8io/fabric8-maven-plugin/tree/master) diff --git a/enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/ConfigMapEnricher.java b/enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/ConfigMapEnricher.java index 1cb48d09cc..f4898cb00a 100644 --- a/enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/ConfigMapEnricher.java +++ b/enricher/standard/src/main/java/io/fabric8/maven/enricher/standard/ConfigMapEnricher.java @@ -58,10 +58,12 @@ private void addAnnotations(KubernetesListBuilder builder) { @Override public void visit(ConfigMapBuilder element) { final Map annotations = element.buildMetadata().getAnnotations(); - try { - addConfigMapFromAnnotations(annotations, element); - } catch (IOException e) { - throw new IllegalArgumentException(e); + if (annotations != null) { + try { + addConfigMapFromAnnotations(annotations, element); + } catch (IOException e) { + throw new IllegalArgumentException(e); + } } } });