Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit 19c3689

Browse files
authored
Fix NullPointerException in ClusterConfiguration while fabric8:watch (#1523)
Changed default constructor to initialize namespace rather than doing nothing
1 parent 96f17eb commit 19c3689

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se
2929
* Feature 718: Detect port number from configuration file for health check in Thorntail
3030
* Refactor 828: Moved Metedata specific code into DefaultMetadataEnricher
3131
* Feature 718: Detect port number from configuration file for health check in Thorntail
32+
* Fix NullPointerException in ClusterConfiguration during fabric8:watch
33+
* Feature 1498: Allow users to define secrets from annotations
3234
* Feature 1498: Allow users to define secrets from annotations
3335
* Fix 1517: update vmp groupid and vert.x version
3436

core/src/main/java/io/fabric8/maven/core/access/ClusterConfiguration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ public class ClusterConfiguration {
4343
private String keyStorePassphrase;
4444

4545
private ClusterConfiguration() {
46+
this.namespace = KubernetesHelper.getDefaultNamespace();
4647
}
4748

4849
public String getNamespace() {
49-
if (StringUtils.isBlank(this.namespace)) {
50-
this.namespace = KubernetesHelper.getDefaultNamespace();
51-
}
5250
return namespace;
5351
}
5452

plugin/src/main/java/io/fabric8/maven/plugin/mojo/develop/WatchMojo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
168168
}
169169

170170
protected ClusterConfiguration getClusterConfiguration() {
171+
if(access == null) {
172+
access = new ClusterConfiguration.Builder().build();
173+
}
171174
final ClusterConfiguration.Builder clusterConfigurationBuilder = new ClusterConfiguration.Builder(access);
172175

173176
return clusterConfigurationBuilder.from(System.getProperties())

0 commit comments

Comments
 (0)