generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove build time namespaces property
When / if quarkusio/quarkus#34094 is addressed, we should revisit this aspect of QOSDK. An alternative solution would also be to extract the generation aspects of the extension into its own module so that people could activate it on demand via a maven profile, for example.
- Loading branch information
Showing
7 changed files
with
81 additions
and
36 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
33 changes: 33 additions & 0 deletions
33
.../deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/RBACAugmentationStep.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,33 @@ | ||
package io.quarkiverse.operatorsdk.deployment; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import io.quarkiverse.operatorsdk.runtime.BuildTimeOperatorConfiguration; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.kubernetes.spi.DecoratorBuildItem; | ||
|
||
public class RBACAugmentationStep { | ||
|
||
private static class IsRBACEnabled implements BooleanSupplier { | ||
|
||
private BuildTimeOperatorConfiguration config; | ||
|
||
@Override | ||
public boolean getAsBoolean() { | ||
return !config.disableRbacGeneration; | ||
} | ||
} | ||
|
||
@BuildStep(onlyIf = IsRBACEnabled.class) | ||
void augmentRBACForResources(BuildTimeOperatorConfiguration buildTimeConfiguration, | ||
BuildProducer<DecoratorBuildItem> decorators, | ||
ControllerConfigurationsBuildItem configurations) { | ||
|
||
final var configs = configurations.getControllerConfigs().values(); | ||
decorators.produce(new DecoratorBuildItem( | ||
new AddClusterRolesDecorator(configs, buildTimeConfiguration.crd.validate))); | ||
decorators.produce(new DecoratorBuildItem( | ||
new AddRoleBindingsDecorator(configs, buildTimeConfiguration))); | ||
} | ||
} |
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