nicolaferraro commented on a change in pull request #317: Option to create an Integration Context from an existing image URL: https://github.com/apache/camel-k/pull/317#discussion_r245692611
########## File path: pkg/cmd/context_create.go ########## @@ -101,14 +119,26 @@ func (command *contextCreateCommand) run(cmd *cobra.Command, args []string) erro ctx = v1alpha1.NewIntegrationContext(command.Namespace, kubernetes.SanitizeName(args[0])) ctx.Labels = map[string]string{ - "camel.apache.org/context.type": "user", + "camel.apache.org/context.type": v1alpha1.IntegrationContextTypeUser, } ctx.Spec = v1alpha1.IntegrationContextSpec{ Dependencies: make([]string, 0, len(command.dependencies)), Configuration: make([]v1alpha1.ConfigurationSpec, 0), - Repositories: command.Repositories, + Repositories: command.repositories, } + if command.image != "" { + // + // if the image is set, the context do not require any build but + // is be marked as external as the information about the classpath + // is missing so it cannot be used as base for other contexts + // + ctx.Labels["camel.apache.org/context.type"] = v1alpha1.IntegrationContextTypeExternal + + ctx.Status = v1alpha1.IntegrationContextStatus{ Review comment: We might add a related field also on spec. I think we should treat status as something that can be deleted and will be synced again by the operator (actually `kamel reset` does this, deleting the status). ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services