christophd commented on code in PR #5200: URL: https://github.com/apache/camel-k/pull/5200#discussion_r1506067360
########## pkg/cmd/install.go: ########## @@ -21,6 +21,7 @@ import ( "context" "errors" "fmt" + "github.com/apache/camel-k/v2/pkg/util/defaults" Review Comment: needs goimports formatting ########## pkg/cmd/install.go: ########## @@ -414,6 +415,21 @@ func (o *installCmdOptions) setupOperator( platformName) } + // Choose an architecture specific an operator/base image when not already given explicitly + if archs, err := kubernetes.NodeArchLookup(o.Context, c); err == nil && len(archs) == 1 { + switch archs[0] { + case "arm64": Review Comment: switch with only one single case? ########## pkg/util/slice.go: ########## @@ -0,0 +1,47 @@ +/* +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 util Review Comment: Some unit tests would be nice ########## pkg/util/defaults/defaults_support.go: ########## @@ -29,6 +29,17 @@ func BaseImage() string { return envOrDefault(baseImage, "KAMEL_BASE_IMAGE", "RELATED_IMAGE_BASE") } +func BaseImageArch(arch string) string { + mapping := map[string]string{ Review Comment: this mapping should be a constant in defaults.go ########## pkg/cmd/install.go: ########## @@ -414,6 +415,21 @@ func (o *installCmdOptions) setupOperator( platformName) } + // Choose an architecture specific an operator/base image when not already given explicitly + if archs, err := kubernetes.NodeArchLookup(o.Context, c); err == nil && len(archs) == 1 { Review Comment: missing some error handling -- 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: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org