-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract route/ingress configuration into a specific object
- Loading branch information
Showing
17 changed files
with
220 additions
and
14 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
23 changes: 23 additions & 0 deletions
23
...eployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyExpositionConfigurator.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,23 @@ | ||
package io.quarkus.kubernetes.deployment; | ||
|
||
import io.dekorate.kubernetes.config.BaseConfigFluent; | ||
import io.dekorate.kubernetes.config.Configurator; | ||
|
||
public class ApplyExpositionConfigurator extends Configurator<BaseConfigFluent> { | ||
|
||
private final ExpositionConfig expositionConfig; | ||
|
||
public ApplyExpositionConfigurator(ExpositionConfig expositionConfig) { | ||
this.expositionConfig = expositionConfig; | ||
} | ||
|
||
@Override | ||
public void visit(BaseConfigFluent config) { | ||
if (expositionConfig.expose) { | ||
config.withExpose(true); | ||
if (expositionConfig.host.isPresent()) { | ||
config.withHost(expositionConfig.host.get()); | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...s/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/ExpositionConfig.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,30 @@ | ||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
@ConfigGroup | ||
public class ExpositionConfig { | ||
|
||
/** | ||
* If true, the service will be exposed | ||
*/ | ||
@ConfigItem | ||
boolean expose; | ||
|
||
/** | ||
* The host under which the application is going to be exposed | ||
*/ | ||
@ConfigItem | ||
Optional<String> host; | ||
|
||
/** | ||
* Custom annotations to add to exposition (route or ingress) resources | ||
*/ | ||
@ConfigItem | ||
Map<String, String> annotations; | ||
|
||
} |
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
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
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
Oops, something went wrong.