robertonav20 commented on issue #1238:
URL: https://github.com/apache/camel-k/issues/1238#issuecomment-1138768091
Ok thanks, i understand your advice and i fix the code just like this.
```
type BuildahTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
// The platform of build image
Platform string `json:"baseImage,omitempty"`
// log more information
Verbose *bool `json:"verbose,omitempty"`
}
case v1.IntegrationPlatformBuildPublishStrategyBuildah:
var platform string
var found bool
if platform, found =
e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahPlatform]; !found
{
platform = platforms.DefaultSpec().OS + "/" +
platforms.DefaultSpec().Architecture + "/" + platforms.DefaultSpec().Variant
}
e.BuildTasks = append(e.BuildTasks, v1.Task{Buildah: &v1.BuildahTask{
Platform: platform,
BaseTask: v1.BaseTask{
Name: "buildah",
},
PublishTask: v1.PublishTask{
Image: getImageName(e),
Registry: e.Platform.Status.Build.Registry,
},
Verbose: t.Verbose,
}})
```
In this way you can manage the platform of image if you want, just fill
`PublishStrategyOptions` with the correct paramater from outside.
But, i don't understand how to works `PublishStrategyOptions`, for kaniko i
found this code inside `install.go`
```
kanikoBuildCacheFlag := cobraCmd.Flags().Lookup("kaniko-build-cache")
if kanikoBuildCacheFlag.Changed {
platform.Spec.Build.PublishStrategyOptions[builder.KanikoBuildCacheEnabled] =
strconv.FormatBool(o.KanikoBuildCache)
}
```
If i undertstand well, with install command you can pass
`kaniko-build-cache` parameter and to set the PublishStrategyOptions, right?
There is another way to fill `PublishStrategyOptions`?
How do you thing to manage the `platform` parameter for buildah?
Thanks in advance! 😄
--
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]