Skip to content

Commit

Permalink
fix(traits): set native build also when Kit native
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Jun 27, 2023
1 parent 4a8072d commit 13f5dd3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/trait/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,14 @@ func (t *builderTrait) builderTask(e *Environment) (*v1.BuilderTask, error) {
}

if trait := e.Catalog.GetTrait(quarkusTraitID); trait != nil {
quarkus, ok := trait.(*quarkusTrait)
isNativeIntegration := quarkus.isNativeIntegration(e)
isNativeKit, err := quarkus.isNativeKit(e)
if err != nil {
return nil, err
}
// The builder trait must define certain resources requirements when we have a native build
if quarkus, ok := trait.(*quarkusTrait); ok && pointer.BoolDeref(quarkus.Enabled, true) && quarkus.isNativeIntegration(e) {
if ok && pointer.BoolDeref(quarkus.Enabled, true) && (isNativeIntegration || isNativeKit) {
// Force the build to run in a separate Pod
t.L.Info("This is a Quarkus native build: setting build configuration with build Pod strategy, 1 CPU core and 4 GiB memory. Make sure your cluster can handle it.")
t.Strategy = string(v1.BuildStrategyPod)
Expand Down

0 comments on commit 13f5dd3

Please sign in to comment.