opendevstack / ods-jenkins-shared-library

Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
Apache License 2.0
72 stars 57 forks source link

ods-infra components require OpenShift projects in Deploy stage #1047

Closed hrcornejo closed 7 months ago

hrcornejo commented 11 months ago

Describe the bug Using a component of type od-infra the Deploy stage in orchestration try to verify that the project exists in OpenShift. An infra component doesn't need a project in Openshift.

To Reproduce Steps to reproduce the behavior:

  1. Create an ods-infra component in a new project (only -dev and -test projects has been created by default in OpenShift.
  2. Create a Release Manager component and configure properly to use the ods-infra component.
  3. Do a release to Prod environment.
  4. See error.

Expected behavior The Release work without the creation of a project in OpenShift.

Log Output (ensure to remove any confidential information like tokens, project names, etc.

java.lang.RuntimeException: Error: target environment 'fake-prod' does not exist in [https://172.30.0.1:443](https://172.30.0.1/).
    at org.ods.orchestration.DeployStage.run(DeployStage.groovy:116)
    at org.ods.orchestration.Stage.runOnAgentPod(Stage.groovy:210)
    at ___cps.transform___(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
    at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.constructorCall(DefaultInvoker.java:25)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
    at jdk.internal.reflect.GeneratedMethodAccessor332.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72).