Skip to content

Commit

Permalink
refactor: move external CRD configuration to main CRD configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <claprun@redhat.com>
  • Loading branch information
metacosm committed Nov 8, 2024
1 parent bdf846e commit 3120324
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ private static String getBundleName(AnnotationInstance csvMetadata, String defau
}

@BuildStep(onlyIf = IsGenerationEnabled.class)
UnownedCRDInfoBuildItem unownedCRDInfo(BundleGenerationConfiguration bundleConfiguration,
UnownedCRDInfoBuildItem unownedCRDInfo(BuildTimeOperatorConfiguration operatorConfiguration,
CurateOutcomeBuildItem appInfoBuildItem) {
final Optional<List<String>> maybeExternalCRDs = bundleConfiguration.externalCRDLocations();
final Optional<List<String>> maybeExternalCRDs = operatorConfiguration.crd().externalCRDLocations();
final var crds = new CRDInfos();
if (maybeExternalCRDs.isPresent()) {
final var moduleRoot = appInfoBuildItem.getApplicationModel().getApplicationModule().getModuleDir().toPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ExternalCRDsTest {
.withApplicationRoot((jar) -> jar
.addClasses(First.class, External.class, ExternalDependentResource.class,
ReconcilerWithExternalCR.class))
.overrideConfigKey("quarkus.operator-sdk.bundle.external-crd-locations",
.overrideConfigKey("quarkus.operator-sdk.crd.external-crd-locations",
"src/test/external-crds/v1beta1spec.crd.yml, src/test/external-crds/external.crd.yml");

@ProdBuildResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,4 @@ public interface BundleGenerationConfiguration {
* @since 6.8.0
*/
Map<String, BundleConfiguration> bundles();

/**
* A comma-separated list of paths where external CRDs that need to be referenced for non-generated custom resources.
* Typical use cases where this might be needed include when custom resource implementations are located in a different
* module than the controller implementation or when the CRDs are not generated at all (e.g. in integration cases where your
* operator needs to deal with 3rd party custom resources).
*
* <p>
* Paths can be either absolute or relative, in which case they will be resolved from the current module root directory.
* </p>
*
* @since 6.8.4
*/
Optional<List<String>> externalCRDLocations();
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ public interface CRDConfiguration {
* process.
*/
Optional<List<String>> excludeResources();

/**
* A comma-separated list of paths where external CRDs that need to be referenced for non-generated custom resources.
* Typical use cases where this might be needed include when custom resource implementations are located in a different
* module than the controller implementation or when the CRDs are not generated at all (e.g. in integration cases where your
* operator needs to deal with 3rd party custom resources).
*
* <p>
* Paths can be either absolute or relative, in which case they will be resolved from the current module root directory.
* </p>
*
* @since 6.8.4
*/
Optional<List<String>> externalCRDLocations();
}

0 comments on commit 3120324

Please sign in to comment.