forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit build item when the effective ServiceAccount name is computed
Signed-off-by: Chris Laprun <[email protected]>
- Loading branch information
Showing
21 changed files
with
539 additions
and
502 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
16 changes: 16 additions & 0 deletions
16
extensions/kubernetes/spi/src/main/java/io/quarkus/kubernetes/spi/BaseTargetable.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,16 @@ | ||
package io.quarkus.kubernetes.spi; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
class BaseTargetable extends MultiBuildItem implements Targetable { | ||
private final String target; | ||
|
||
protected BaseTargetable(String target) { | ||
this.target = target; | ||
} | ||
|
||
@Override | ||
public String getTarget() { | ||
return target; | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
...i/src/main/java/io/quarkus/kubernetes/spi/KubernetesEffectiveServiceAccountBuildItem.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,53 @@ | ||
package io.quarkus.kubernetes.spi; | ||
|
||
/** | ||
* This build item is produced once the effective service account used for the generated resources is computed. Useful for | ||
* downstream | ||
* extensions that need to know this information to wait until it is made available. | ||
*/ | ||
public final class KubernetesEffectiveServiceAccountBuildItem extends BaseTargetable { | ||
private final String serviceAccountName; | ||
private final String namespace; | ||
private final boolean wasSet; | ||
|
||
public KubernetesEffectiveServiceAccountBuildItem(String serviceAccountName, String namespace, boolean wasSet) { | ||
this(serviceAccountName, namespace, wasSet, null); | ||
} | ||
|
||
public KubernetesEffectiveServiceAccountBuildItem(String serviceAccountName, String namespace, boolean wasSet, | ||
String target) { | ||
super(target); | ||
this.serviceAccountName = serviceAccountName; | ||
this.namespace = namespace; | ||
this.wasSet = wasSet; | ||
} | ||
|
||
/** | ||
* The effective service account name after all the build time configuration has taken effect | ||
* | ||
* @return the effective service account name as used in the generated manifests for the main application deployment | ||
*/ | ||
public String getServiceAccountName() { | ||
return serviceAccountName; | ||
} | ||
|
||
/** | ||
* The effective service account namespace | ||
* | ||
* @return the effective service account name as used in the generated manifests for the main application deployment | ||
*/ | ||
public String getNamespace() { | ||
return namespace; | ||
} | ||
|
||
/** | ||
* Determines whether the service account name is automatically derived from the application name as opposed to explicitly | ||
* set by the user | ||
* | ||
* @return {@code true} if the service account is automatically derived from the application name, {@code false} if | ||
* explicitly set by the user | ||
*/ | ||
public boolean wasSet() { | ||
return wasSet; | ||
} | ||
} |
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.