You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2019/02/13 08:48:22 UTC

[GitHub] rhuss commented on a change in pull request #423: feature(kamel): Validate --context when given

rhuss commented on a change in pull request #423: feature(kamel): Validate --context when given
URL: https://github.com/apache/camel-k/pull/423#discussion_r256294336
 
 

 ##########
 File path: pkg/cmd/install.go
 ##########
 @@ -230,3 +235,43 @@ func (o *installCmdOptions) waitForPlatformReady(platform *v1alpha1.IntegrationP
 
 	return watch.HandlePlatformStateChanges(o.Context, platform, handler)
 }
+
+func (o *installCmdOptions) validate(cmd *cobra.Command, args []string) error {
+	var result error
+
+	// Let's register only our own APIs
+	schema := runtime.NewScheme()
+	if err := apis.AddToScheme(schema); err != nil {
+		return err
+	}
+
+	if o.contexts == nil {
+		return nil
+	}
+	for _, context := range o.contexts {
+		err := errorIfContextIsNotAvailable(schema, context)
 
 Review comment:
   Valid point. I added a check for "none", too now so that is a valid input.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services