Skip to content

Commit

Permalink
feat(trait): Quarkus Native to spin off a Builder Pod
Browse files Browse the repository at this point in the history
This commit enables the separation between the container image used by the build and the one used by the operator. The operator will be now free not to inherit an image containing the tools required by the Native builds, as it will never be required to run a Quarkus Native build.
  • Loading branch information
squakez committed Feb 2, 2023
1 parent 48f902c commit 98ca5f5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/trait/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ func (t *quarkusTrait) Configure(e *Environment) (bool, error) {
}

func (t *quarkusTrait) Apply(e *Environment) error {
if t.hasKitNativeType(e) {
// Force the build to run in a separate Pod
t.L.Info("Quarkus Native requires a build pod strategy")
e.BuildStrategy = v1.BuildStrategyPod
// TODO we may provide a set of sensible resource default values for the Pod spun off
}

if e.IntegrationInPhase(v1.IntegrationPhaseBuildingKit) {
t.applyWhileBuildingKit(e)

Expand Down Expand Up @@ -300,6 +307,15 @@ func (t *quarkusTrait) isNativeKit(e *Environment) (bool, error) {
}
}

func (t *quarkusTrait) hasKitNativeType(e *Environment) bool {
for _, v := range t.PackageTypes {
if v == traitv1.NativePackageType {
return true
}
}
return false
}

func (t *quarkusTrait) applyWhenKitReady(e *Environment) error {
if e.IntegrationInRunningPhases() && t.isNativeIntegration(e) {
container := e.GetIntegrationContainer()
Expand Down

0 comments on commit 98ca5f5

Please sign in to comment.