All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.operatorsdk.it.AnnotatedDependentResource Maven / Gradle / Ivy

There is a newer version: 6.9.1
Show newest version
package io.quarkiverse.operatorsdk.it;

import java.util.Optional;

import io.fabric8.kubernetes.api.model.Service;
import io.javaoperatorsdk.operator.api.config.ControllerConfiguration;
import io.javaoperatorsdk.operator.api.config.dependent.ConfigurationConverter;
import io.javaoperatorsdk.operator.api.config.dependent.Configured;
import io.javaoperatorsdk.operator.api.reconciler.Context;
import io.javaoperatorsdk.operator.api.reconciler.dependent.DependentResource;
import io.javaoperatorsdk.operator.api.reconciler.dependent.ReconcileResult;
import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.DependentResourceConfigurator;

@ADRConfigurationAnnotation(AnnotatedDependentResource.VALUE)
@Configured(by = ADRConfigurationAnnotation.class, with = ADRConfiguration.class, converter = AnnotatedDependentResource.class)
public class AnnotatedDependentResource implements DependentResource,
        DependentResourceConfigurator,
        ConfigurationConverter {

    public static final int VALUE = 42;
    private ADRConfiguration config;

    @Override
    public ReconcileResult reconcile(Service service, Context context) {
        return null;
    }

    @Override
    public Class resourceType() {
        return TestResource.class;
    }

    @Override
    public void configureWith(ADRConfiguration adrConfiguration) {
        this.config = adrConfiguration;
    }

    @Override
    public Optional configuration() {
        return Optional.ofNullable(config);
    }

    @Override
    public ADRConfiguration configFrom(ADRConfigurationAnnotation adrConfigurationAnnotation,
            ControllerConfiguration controllerConfiguration,
            Class aClass) {
        return new ADRConfiguration(adrConfigurationAnnotation.value());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy