subhramit commented on code in PR #6734:
URL: https://github.com/apache/camel-k/pull/6734#discussion_r3691969223


##########
pkg/trait/owner.go:
##########
@@ -142,3 +153,7 @@ func (t *ownerTrait) propagateLabelAndAnnotations(res 
metav1.Object, targetLabel
        }
        res.SetLabels(labels)
 }
+
+func containsWildcard(values []string) bool {
+       return slices.Contains(values, "*")

Review Comment:
   Here we are not comparing one string if its equal to `*`, but checking if 
any of the values passed (which are labels or annotations, this helper being 
separately called for the two lists) are equal to `*`. Hence, `slices.Contains`.
   
   Although semantically, this is unlikely to happen, but since the code path 
allows it, if the user passes mixed labels or annotations, one of them being 
`*`, such as:
   ```yaml
   targetLabels:
     - app
     - team
     - "*"
     ```
   it should be treated equivalent to just `- *`.
   If the first value itself is equal to `*`, `Contains` it will return early 
(which is also for the case of only `*` being passed that you are probably 
having in mind).



-- 
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]

Reply via email to