squakez commented on code in PR #3631:
URL: https://github.com/apache/camel-k/pull/3631#discussion_r969820383
##########
pkg/cmd/install.go:
##########
@@ -734,6 +723,37 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _
[]string) error {
return result
}
+// addBuildPublishStrategyOptions parses and adds all the build publish
strategy options to the given IntegrationPlatformBuildSpec.
+func (o *installCmdOptions) addBuildPublishStrategyOptions(build
*v1.IntegrationPlatformBuildSpec) error {
+ for _, option := range o.BuildPublishStrategyOptions {
+ kv := strings.Split(option, "=")
+ if len(kv) == 2 {
+ key := kv[0]
+ if
builder.IsSupportedPublishStrategyOption(build.PublishStrategy, key) {
+ build.AddOption(key, kv[1])
+ } else {
+ return fmt.Errorf("build publish strategy
option '%s' not supported. %s", option,
supportedOptionsAsString(build.PublishStrategy))
+ }
+ } else {
+ return fmt.Errorf("build publish strategy option '%s'
not in the expected format (name=value)", option)
+ }
+ }
+ return nil
+}
+
+// supportedOptionsAsString provides all the supported options for the given
strategy as string.
+func supportedOptionsAsString(strategy
v1.IntegrationPlatformBuildPublishStrategy) string {
Review Comment:
+1 on this
--
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]