Skip to content

Have access to Fabric8 OpenShift Client #330

@jmesnil

Description

@jmesnil

In my operator, if I detect that I'm running on OpenShift, I have specific resources to install (e.g. a Route).

I want to be able to use fabric8 OpenShiftClient in those cases (after detecting that I'm running on OpenShift) to do that with Java types to interact with these OpenShift resources .

I'm using the operator-framework-quarkus-extension to build my operator and if I inject a io.fabric8.openshift.client.OpenShiftClient it fails with

[ERROR]         [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type io.fabric8.openshift.client.OpenShiftClient and qualifiers [@Default]
[ERROR]         - java member: org.wildfly.operator.WildFlyOperator#client
[ERROR]         - declared on CLASS bean [types=[io.quarkus.runtime.QuarkusApplication, org.wildfly.operator.WildFlyOperator, java.lang.Object], qualifiers=[@Default, @Any], target=org.wildfly.operator.WildFlyOperator]

That'd be great if I could inject an OpenShift client (and maybe make it optional if the container platform is not detect to be OpenShift). Something like

    // always injected
    @Inject
    KubernetesClient client;

    // present only if the container platform is openshift
    @Inject
    Optional<OpenShiftClient> client;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions