Search in sources :

Example 1 with ManagedConnectorOperator

use of org.bf2.cos.fleetshard.api.ManagedConnectorOperator in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class ManagedConnectorOperatorSteps method a_managedConnectorOperator.

@Given("^a ManagedConnectorOperator with:$")
public void a_managedConnectorOperator(Map<String, String> entry) {
    final String operatorId = entry.getOrDefault("operator.id", uid());
    final String operatorType = entry.get("operator.type");
    final String operatorVersion = entry.get("operator.version");
    final String operatorRuntime = entry.get("operator.runtime");
    var connector = new ManagedConnectorOperatorBuilder().withMetadata(new ObjectMetaBuilder().withName(operatorId).addToLabels(Resources.LABEL_OPERATOR_TYPE, operatorType).addToLabels(Resources.LABEL_OPERATOR_VERSION, operatorVersion).build()).withSpec(new ManagedConnectorOperatorSpecBuilder().withVersion(operatorVersion).withType(operatorType).withRuntime(operatorRuntime).build()).build();
    ctx.managedConnectorOperator(connector);
}
Also used : ManagedConnectorOperatorBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorOperatorBuilder) ObjectMetaBuilder(io.fabric8.kubernetes.api.model.ObjectMetaBuilder) ManagedConnectorOperatorSpecBuilder(org.bf2.cos.fleetshard.api.ManagedConnectorOperatorSpecBuilder) Given(io.cucumber.java.en.Given)

Example 2 with ManagedConnectorOperator

use of org.bf2.cos.fleetshard.api.ManagedConnectorOperator in project cos-fleetshard by bf2fc6cc711aee1a0c2a.

the class ConnectorController method prepareEventSources.

@Override
public List<EventSource> prepareEventSources(EventSourceContext context) {
    var eventSources = new ArrayList<EventSource>();
    eventSources.add(new ConnectorSecretEventSource(kubernetesClient, managedConnectorOperator, MetricsRecorder.of(registry, config.metrics().baseName() + ".controller.event.secrets", tags)));
    eventSources.add(new ConnectorOperatorEventSource(kubernetesClient, managedConnectorOperator, fleetShard.getNamespace(), MetricsRecorder.of(registry, config.metrics().baseName() + ".controller.event.operators", tags)));
    for (ResourceDefinitionContext res : operandController.getResourceTypes()) {
        final String id = res.getGroup() + "-" + res.getVersion() + "-" + res.getKind();
        eventSources.add(new OperandResourceWatcher(id, kubernetesClient, managedConnectorOperator, res, MetricsRecorder.of(registry, id, tags)));
    }
    return eventSources;
}
Also used : ResourceDefinitionContext(io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext) OperandResourceWatcher(org.bf2.cos.fleetshard.operator.operand.OperandResourceWatcher) ArrayList(java.util.ArrayList)

Aggregations

Given (io.cucumber.java.en.Given)1 ObjectMetaBuilder (io.fabric8.kubernetes.api.model.ObjectMetaBuilder)1 ResourceDefinitionContext (io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext)1 ArrayList (java.util.ArrayList)1 ManagedConnectorOperatorBuilder (org.bf2.cos.fleetshard.api.ManagedConnectorOperatorBuilder)1 ManagedConnectorOperatorSpecBuilder (org.bf2.cos.fleetshard.api.ManagedConnectorOperatorSpecBuilder)1 OperandResourceWatcher (org.bf2.cos.fleetshard.operator.operand.OperandResourceWatcher)1