fabric8io/fabric8-maven-plugin

Deployment to OpenShift 4.6 not working using login parameters instead of oc login

apupier opened this issue ยท 7 comments

Description

Info

  • f-m-p version :

  • Maven version (mvn -v) : 3.6.3

  • Kubernetes / OpenShift setup and version : OpenShift 4.6.9

  • If it's a bug, how to reproduce ๐Ÿ‘

    • Ensure that you are nto logged in locally oc logout
    • Create a project in an OpenShift 4.6.x instance, fo risntance named 78
    • clone https://github.com/apupier/fabric8-maven-plugin-not-working-example
    • cd ose-78
    • mvn clean install fabric8:deploy -Dkubernetes.master=https://api.crc.testing:6443 -Dkubernetes.namespace=78 -Dkubernetes.auth.basic.username=developer -Dkubernetes.auth.basic.password=developer -Dfabric8.mode=openshift -Dkubernetes.trust.certificates=true -Dfabric8.build.strategy=s2i -Dkubernetes.auth.tryServiceAccount=false -Dfabric8.generator.from=registry.access.redhat.com/fuse7/fuse-java-openshift -Dfabric8.generator.fromMode=docker -Dkubernetes.auth.tryKubeConfig=false

the error is:

INFO] --- fabric8-maven-plugin:7.8.0.fuse-sb2-780038-redhat-00001:build (default) @ camel-ose-springboot-xml ---
[INFO] F8: Running in OpenShift mode
[INFO] F8: Using OpenShift build with strategy S2I
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Container image registry.access.redhat.com/fuse7/fuse-java-openshift as base / builder
[ERROR] F8: Failed to execute the build: java.lang.IllegalStateException: Openshift platform has been specified but Openshift has not been detected!

I tried several variations but this one is working for sure with OpenShift 3.11.
With same project, when logged in through oc, it is workign fine deployign on OpenShift 4.6.

@apupier : Hi, I'm not sure whether you're aware of this or not but we've migrated[0] Fabric8 Maven Plugin to Eclipse JKube[1]. I haven't tried out FMP/JKube with login parameters on OpenShift 4.6. Could you please try migrating to Eclipse JKube and see if error gets resolved? If it doesn't work, I would appreciate if you could create an issue on Eclipse JKube Github repository.

[0] https://developers.redhat.com/blog/2020/09/21/migrating-from-fabric8-maven-plugin-to-eclipse-jkube-1-0-0/
[1] https://github.com/eclipse/jkube

Maybe the Kubernetes-Client dependency that version of FMP relies on is not compatible with OpenShift 4.6 (or its auth mechanism)

it relies on fabric8-maven-plugin 4.3.0.fuse-780012-redhat-00001

last version marked here https://github.com/fabric8io/fabric8-maven-plugin#openshift-and-kubernetes-compatibility is OpenShift 4.2 but here it is claimed compatibility with 4.6 https://access.redhat.com/articles/310603#Red-Hat-Fuse-78

it is not working neither with JKube eclipse/jkube#566

Yes, I saw. We'll investigate in scope of eclipse/jkube#566.
Do you experience the issue just with 4.6 or with any 4.x cluster?

Do you experience the issue just with 4.6 or with any 4.x cluster?

not tried recently with other 4.x. I think it worked with 4.0 but it was a long time ago, I'm not sure.

stale commented

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

fixed with openshift-maven-plugin