generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: provide per-bundle configuration via properties
Fixes #903 Signed-off-by: Chris Laprun <claprun@redhat.com>
- Loading branch information
Showing
7 changed files
with
142 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../runtime/src/main/java/io/quarkiverse/operatorsdk/bundle/runtime/BundleConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkiverse.operatorsdk.bundle.runtime; | ||
|
||
import java.util.Map; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
|
||
@ConfigGroup | ||
public interface BundleConfiguration { | ||
String OLM_SKIP_RANGE_ANNOTATION = "olm.skipRange"; | ||
String CONTAINER_IMAGE_ANNOTATION = "containerImage"; | ||
String REPOSITORY_ANNOTATION = "repository"; | ||
String CAPABILITIES_ANNOTATION = "capabilities"; | ||
String CATEGORIES_ANNOTATION = "categories"; | ||
String CERTIFIED_ANNOTATION = "certified"; | ||
String ALM_EXAMPLES_ANNOTATION = "alm-examples"; | ||
|
||
/** | ||
* The bundle's annotations (as found in the CSV metadata) | ||
*/ | ||
Map<String, String> annotations(); | ||
|
||
default void mergeWithDefaults(BundleConfiguration defaults) { | ||
final var annotations = annotations(); | ||
if (annotations != null) { | ||
annotations.keySet().forEach(key -> annotations.computeIfAbsent(key, k -> defaults.annotations().get(k))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters