You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/08/30 07:56:58 UTC

[GitHub] [camel-k] squakez commented on issue #2446: propagate labels to deployments and pods

squakez commented on issue #2446:
URL: https://github.com/apache/camel-k/issues/2446#issuecomment-908127606


   The correct way to have it working with the actual `owner` trait is the following one:
   ```
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   ...
   metadata:
   ...
     labels:
       my-key: my-val
       ...
     annotations:
       trait.camel.apache.org/owner.target-labels: "my-key"
   ```
   ```
   k get pod --show-labels -n operator-test
   NAME                            READY   STATUS    RESTARTS   AGE   LABELS
   timer-to-log-686fc7f567-gfhb6   1/1     Running   0          8s    camel.apache.org/integration=timer-to-log,my-key=my-val,pod-template-hash=686fc7f567
   ```
   Basically we need to specify in the `KameletBinding` which labels (and/or annotations) we want to have in the underlying `Pod`.
   
   In the KameletBinding usage, I think it's a bit cumbersome as we need to re-declare a list of variables we already defined. In my opinion we should add a `owner.target-labels-all` to cover the generic usage of including all labels/annotations. We can also consider if the default for the `KameletBinding` is to use the `owner` trait, so the user won't have to bother to configure (he can disable by turning `enabled=false`).


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org