Skip to content

Allow DI for condition and discriminator classes #720

Open
@Javatar81

Description

@Javatar81

There are several attributes that refer to a singleton object represented by its Class, e.g. conditions and discriminators. Examples are:

@KubernetesDependent(resourceDiscriminator = MyDiscriminator.class)

@Dependent(reconcilePrecondition = MyReconcilepreondition.class)

@Dependent(readyPostcondition = MyReadyPostcondition.class)

@Dependent(deletePostcondition = MyDeletePostcondition.class)

There is no way to inject additional dependencies into these classes since they are always instantiated via their default constructor. It would be useful to support attribute and constructor injection via CDI.

One use case is to inject the OpenShiftClient into a reconcile precondition class to implement checks agains the OCP API.

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