diff --git a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java index 52def292..7db61474 100644 --- a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java +++ b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/OperatorSDKProcessor.java @@ -44,7 +44,6 @@ import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.AdditionalIndexedClassesBuildItem; -import io.quarkus.deployment.builditem.ApplicationIndexBuildItem; import io.quarkus.deployment.builditem.CombinedIndexBuildItem; import io.quarkus.deployment.builditem.ConsoleCommandBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; @@ -197,30 +196,6 @@ AnnotationConfigurablesBuildItem gatherAnnotationConfigurables( return new AnnotationConfigurablesBuildItem(configurableInfos); } - /** - * Gathers the CustomResource implementations that are not part of the application index because they are part of an - * external, reusable module for example. - * - * Note that this will be obsolete once Quarkus #38586 is - * usable - * - * @param combinedIndexBuildItem - * @param applicationIndexBuildItem - * @param reflectiveClassProducer - */ - @BuildStep - void gatherOutOfAppCustomResourceImplementations(CombinedIndexBuildItem combinedIndexBuildItem, - ApplicationIndexBuildItem applicationIndexBuildItem, - BuildProducer reflectiveClassProducer) { - final var combinedIndex = combinedIndexBuildItem.getIndex(); - final var appIndex = applicationIndexBuildItem.getIndex(); - - // only add the CRs found in the combined index that were not already in the application one since Quarkus should already handle these - final var crsFromCombined = combinedIndex.getAllKnownSubclasses(Constants.CUSTOM_RESOURCE); - crsFromCombined.removeAll(appIndex.getAllKnownSubclasses(Constants.CUSTOM_RESOURCE)); - crsFromCombined.forEach(ci -> reflectiveClassProducer.produce(new QOSDKReflectiveClassBuildItem(ci.name().toString()))); - } - @BuildStep void registerClassesForReflection( List toRegister, @@ -268,7 +243,6 @@ void initializeRuntimeNamespacesFromBuildTimeValues( ControllerConfigurationsBuildItem configurations, BuildProducer runtimeConfig) { configurations.getControllerConfigs().forEach((name, configuration) -> { - @SuppressWarnings("unchecked") final var namespaces = String.join(",", configuration.getInformerConfig().getNamespaces()); runtimeConfig.produce(new RunTimeConfigurationDefaultBuildItem( "quarkus.operator-sdk.controllers." + configuration.getName() + ".namespaces", @@ -280,7 +254,6 @@ void initializeRuntimeNamespacesFromBuildTimeValues( private void registerAssociatedClassesForReflection(BuildProducer reflectionClasses, BuildProducer forcedReflectionClasses, Set classNamesToRegister) { - // todo: use builder API when/if https://github.com/quarkusio/quarkus/pull/38679 is available classNamesToRegister.forEach(cn -> { reflectionClasses.produce( ReflectiveHierarchyBuildItem.builder(Type.create(DotName.createSimple(cn), Type.Kind.CLASS)) diff --git a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/QuarkusControllerConfigurationBuildStep.java b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/QuarkusControllerConfigurationBuildStep.java index 543f8de9..2ef98318 100644 --- a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/QuarkusControllerConfigurationBuildStep.java +++ b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/QuarkusControllerConfigurationBuildStep.java @@ -292,10 +292,6 @@ static QuarkusControllerConfiguration createConfiguration( // compute workflow and set it initializeWorkflowIfNeeded(configuration, reconcilerInfo, index); - // need to set the namespaces after the dependents have been set so that they can be properly updated if needed - // however, we need to do it in a way that doesn't reset whether the namespaces were set by the user or not - configuration.propagateNamespacesToDependents(); - log.infov( "Processed ''{0}'' reconciler named ''{1}'' for ''{2}'' resource (version ''{3}'')", reconcilerClassName, name, resourceFullName, HasMetadata.getApiVersion(resourceClass)); diff --git a/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusControllerConfiguration.java b/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusControllerConfiguration.java index ae504e8a..1b0f70a9 100644 --- a/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusControllerConfiguration.java +++ b/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusControllerConfiguration.java @@ -161,27 +161,6 @@ void setNamespaces(Set namespaces) { .withNamespaces(namespaces) .buildForController()); wereNamespacesSet = true; - // propagate namespace changes to the dependents' config if needed - propagateNamespacesToDependents(); - } - } - - /** - * Record potentially user-set namespaces, updating the dependent resources, which should have been set before this method - * is called. Note that this method won't affect the status of whether the namespaces were set by the user or not, as this - * should have been recorded already when the instance was created. - * This method, while public for visibility purpose from the deployment module, should be considered internal and *NOT* be - * called from user code. - */ - @SuppressWarnings("unchecked") - public void propagateNamespacesToDependents() { - if (workflow != null) { - dependentsMetadata().forEach((unused, spec) -> { - final var config = spec.getConfiguration().orElse(null); - if (config instanceof QuarkusKubernetesDependentResourceConfig qConfig) { - qConfig.setNamespaces(informerConfig.getNamespaces()); - } - }); } } diff --git a/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusKubernetesDependentResourceConfig.java b/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusKubernetesDependentResourceConfig.java index 8f2bf6e9..75f6a08c 100644 --- a/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusKubernetesDependentResourceConfig.java +++ b/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/QuarkusKubernetesDependentResourceConfig.java @@ -1,7 +1,5 @@ package io.quarkiverse.operatorsdk.runtime; -import java.util.Set; - import io.fabric8.kubernetes.api.model.HasMetadata; import io.javaoperatorsdk.operator.api.config.informer.InformerConfiguration; import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResourceConfig; @@ -32,8 +30,4 @@ public Boolean isUseSSA() { public InformerConfiguration getInformerConfig() { return informerConfig(); } - - void setNamespaces(Set namespaces) { - // todo: remove? - } }