Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace as resource fragment results in NullPointerException #511

Closed
rohanKanojia opened this issue Dec 3, 2020 · 1 comment · Fixed by #520
Closed

Namespace as resource fragment results in NullPointerException #511

rohanKanojia opened this issue Dec 3, 2020 · 1 comment · Fixed by #520
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rohanKanojia
Copy link
Member

Description

We have DefaultNamespaceEnricher which seems to be taking care of creating a namespace on the fly when provided as a resource fragment. However, when I add a simple Namespace resource fragment in src/main/jkube like this:

apiVersion: v1
kind: Namespace
metadata:
  name: test-jkube

It results in NullPointerException:

[INFO] Building Eclipse JKube :: Quickstarts :: Maven :: External Resources 1.0.2
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- kubernetes-maven-plugin:1.0.2:resource (default-cli) @ external-resources ---
[INFO] k8s: Running generator spring-boot
[INFO] k8s: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.8 as base / builder                                                                                               
[INFO] k8s: Using resource templates from /home/rohaan/work/repos/eclipse-jkube-sample-with-resource-fragments/src/main/jkube
[INFO] k8s: jkube-controller: Adding a default Deployment
[INFO] k8s: jkube-healthcheck-spring-boot: Adding readiness probe on port 8080, path='/health', scheme='HTTP', with initial delay 10 seconds
[INFO] k8s: jkube-healthcheck-spring-boot: Adding liveness probe on port 8080, path='/health', scheme='HTTP', with initial delay 180 seconds
[INFO] k8s: jkube-revision-history: Adding revision history limit to 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.901 s
[INFO] Finished at: 2020-12-03T19:29:48+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.2:resource (default-cli) on project external-resources: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.2:resource failed.: NullPointerException -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Info

  • Eclipse JKube version : 1.0.2
  • Maven version (mvn -v) :
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/apache-maven-3.6.3
Java version: 1.8.0_271, vendor: Oracle Corporation, runtime: /usr/lib/java/jdk1.8.0_271/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.9.10-200.fc33.x86_64", arch: "amd64", family: "unix"

@manusa manusa added the bug Something isn't working label Dec 3, 2020
@manusa manusa added this to the 1.1.0 milestone Dec 3, 2020
@manusa
Copy link
Member

manusa commented Dec 3, 2020

Relates to #146

@rohanKanojia rohanKanojia self-assigned this Dec 9, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 10, 2020
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 10, 2020
…PointerException

+ DefaultNamespaceEnricher should handle case when status is not
  provided in resource spec.
+ .metadata.namespace should be omitted from Project/Namespace resources
  since they are Cluster scoped
+ UndeployService should consider Project/Namespace resource while
  deletion phase
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 23, 2020
…PointerException

+ DefaultNamespaceEnricher should handle case when status is not
  provided in resource spec.
+ .metadata.namespace should be omitted from Project/Namespace resources
  since they are Cluster scoped
+ UndeployService should consider Project/Namespace resource while
  deletion phase
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jan 13, 2021
…PointerException

+ DefaultNamespaceEnricher should handle case when status is not
  provided in resource spec.
+ .metadata.namespace should be omitted from Project/Namespace resources
  since they are Cluster scoped
+ UndeployService should consider Project/Namespace resource while
  deletion phase
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jan 15, 2021
…PointerException

+ DefaultNamespaceEnricher should handle case when status is not
  provided in resource spec.
+ .metadata.namespace should be omitted from Project/Namespace resources
  since they are Cluster scoped
+ UndeployService should consider Project/Namespace resource while
  deletion phase
manusa pushed a commit that referenced this issue Jan 18, 2021
+ DefaultNamespaceEnricher should handle case when status is not
  provided in resource spec.
+ .metadata.namespace should be omitted from Project/Namespace resources
  since they are Cluster scoped
+ UndeployService should consider Project/Namespace resource while
  deletion phase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants