wmedvede commented on code in PR #495: URL: https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/495#discussion_r1778796543
########## internal/controller/platform/platformutils.go: ########## @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package platform + +import ( + "context" + "regexp" + "strings" + + "github.com/apache/incubator-kie-kogito-serverless-operator/utils" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + + "github.com/apache/incubator-kie-kogito-serverless-operator/internal/controller/cfg" + + operatorapi "github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08" + ctrl "sigs.k8s.io/controller-runtime/pkg/client" +) + +var builderDockerfileFromRE = regexp.MustCompile(`FROM (.*) AS builder`) + +// ResourceCustomizer can be used to inject code that changes the objects before they are created. +type ResourceCustomizer func(object ctrl.Object) ctrl.Object + +// GetCustomizedBuilderDockerfile determines if the default Dockerfile provided by the +// sonataflow-operator-builder-config_v1_configmap.yaml must be customized to use a different builder base image, +// before building a workflow. +// The following ordered criteria are applied: +// 1) if the current platform has a configured platform.Spec.Build.Config.BaseImage, that base image must be used. +// 2) if the current sonataflow-operator-controllers-config.yaml has a configured SonataFlowBaseBuilderImageTag, that +// base image must be used. +// 3) No customization apply. +func GetCustomizedBuilderDockerfile(dockerfile string, platform operatorapi.SonataFlowPlatform) string { Review Comment: ah, ok, here ########## internal/controller/platform/defaults.go: ########## @@ -160,30 +182,26 @@ func GetRegistryAddress(ctx context.Context) (*string, error) { return nil, nil } -// GetCustomizedBuilderDockerfile determines if the default Dockerfile provided by the -// sonataflow-operator-builder-config_v1_configmap.yaml must be customized to use a different builder base image, -// before building a workflow. -// The following ordered criteria are applied: -// 1) if the current platform has a configured platform.Spec.Build.Config.BaseImage, that base image must be used. -// 2) if the current sonataflow-operator-controllers-config.yaml has a configured SonataFlowBaseBuilderImageTag, that -// base image must be used. -// 3) No customization apply. -func GetCustomizedBuilderDockerfile(dockerfile string, platform operatorapi.SonataFlowPlatform) string { Review Comment: This was an important fix introduced in the last days, where is this now? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
