-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
When listing all applications of a domain, the domains are built out of the json reponse from the backend. It turns out that old apps, that were created before OpenShift had gear profile, are currently reported with a null gear profile. The client then throws an assertion exception:
openshift jenkins client running into an Assertion Exception when the gear profile's null
com.openshift.internal.client.utils.Assert$AssertionFailedException at com.openshift.internal.client.utils.Assert.notNull(Assert.java:32) at com.openshift.internal.client.GearProfile.<init>(GearProfile.java:24) at com.openshift.internal.client.response.ResourceDTOFactory.createApplication(ResourceDTOFactory.java:378) at com.openshift.internal.client.response.ResourceDTOFactory.createApplications(ResourceDTOFactory.java:353) at com.openshift.internal.client.response.ResourceDTOFactory.get(ResourceDTOFactory.java:113) at com.openshift.internal.client.RestService.request(RestService.java:90) at com.openshift.internal.client.RestService.request(RestService.java:74) at com.openshift.internal.client.AbstractOpenShiftResource$ServiceRequest.execute(AbstractOpenShiftResource.java:137) at com.openshift.internal.client.DomainResource.loadApplications(DomainResource.java:189) at com.openshift.internal.client.DomainResource.getApplications(DomainResource.java:179) at com.openshift.internal.client.DomainResource.getApplicationByName(DomainResource.java:141) at com.openshift.internal.client.DomainResource.hasApplicationByName(DomainResource.java:151) at com.openshift.internal.client.DomainResource.createApplication(DomainResource.java:126) at com.openshift.internal.client.DomainResource.createApplication(DomainResource.java:112)
ResourceDTOFactory extracting the gear profile name and passing it to GearProfile
final IGearProfile gearProfile = new GearProfile(getAsString(appNode, PROPERTY_GEAR_PROFILE));
GearProfile asserting a non-null name in the constructor
public GearProfile(String name) { Assert.notNull(name); this.name = name; }