christophd commented on code in PR #3358:
URL: https://github.com/apache/camel-k/pull/3358#discussion_r906302072
##########
pkg/apis/camel/v1/integration_types_support.go:
##########
@@ -255,6 +255,15 @@ func (in *SourceSpec) InferLanguage() Language {
return ""
}
+// SetOperatorID sets the given operator id as an annotation
+func (in *Integration) SetOperatorID(operatorID string) {
+ if in.Annotations == nil {
+ in.Annotations = make(map[string]string)
+ }
+
+ in.Annotations[OperatorIDAnnotation] = operatorID
+}
+
Review Comment:
👍
##########
pkg/cmd/bind.go:
##########
@@ -217,6 +235,36 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args
[]string) error {
binding.Spec.Integration.Traits = traits
}
+ if binding.Annotations == nil {
+ binding.Annotations = make(map[string]string)
+ }
+
+ if o.OperatorID != "" {
+ if pl, err := platformutil.LookupForPlatformName(o.Context,
client, o.OperatorID); err != nil {
+ if k8serrors.IsForbidden(err) {
+ o.PrintfVerboseOutf(cmd, "Unable to verify
existence of operator id [%s] due to lack of user privileges\n", o.OperatorID)
+ } else {
+ return err
+ }
+ } else if pl == nil {
+ if o.Force {
+ o.PrintfVerboseOutf(cmd, "Unable to find
operator with given id [%s] - Kamelet binding may not be reconciled and get
stuck in waiting state\n", o.OperatorID)
+ } else {
+ return fmt.Errorf("unable to find integration
platform for given operator id '%s', use --force option or make sure to use a
proper operator id", o.OperatorID)
+ }
+ }
+ }
Review Comment:
👍
--
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]