You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/06/07 07:52:04 UTC

[camel-k] branch release-1.9.x updated (c58cce846 -> c8803d885)

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a change to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from c58cce846 chore(lint): sort disabled linters
     new 9494c7dc4 Detect wire tap EIP endpoints
     new 3f6a6d0b2 Enable parsing pod template as a modeline.
     new c8803d885 feat: add basic support for PodSecurityContext

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 addons/keda/duck/v1alpha1/zz_generated.deepcopy.go |   1 +
 .../strimzi/duck/v1beta2/zz_generated.deepcopy.go  |   1 +
 .../crd/bases/camel.apache.org_integrations.yaml   | 168 ++++++++++++++++++++
 .../bases/camel.apache.org_kameletbindings.yaml    | 172 +++++++++++++++++++++
 .../attachments/schema/integration-schema.json     | 105 ++++++++++++-
 docs/modules/ROOT/partials/apis/camel-k-crds.adoc  |  10 +-
 docs/modules/ROOT/partials/apis/crds-html.adoc     |  13 ++
 .../files/template-with-supplemental-groups.yaml}  |   7 +-
 e2e/common/traits/pod_test.go                      |  83 +++++++---
 examples/wiretap/README.md                         |   3 +
 examples/{basic/Env.java => wiretap/WireTap.java}  |  13 +-
 go.mod                                             |   1 +
 go.sum                                             |   1 +
 helm/camel-k/crds/crd-integration.yaml             | 168 ++++++++++++++++++++
 helm/camel-k/crds/crd-kamelet-binding.yaml         | 172 +++++++++++++++++++++
 pkg/apis/camel/v1/integration_types.go             |   2 +
 pkg/apis/camel/v1/zz_generated.deepcopy.go         |   2 +
 pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go   |   1 +
 pkg/cmd/modeline_test.go                           |  21 +++
 pkg/cmd/run_test.go                                |  33 ++++
 .../integration/integration_controller.go          |   2 +-
 pkg/resources/resources.go                         |  14 +-
 pkg/trait/pod_test.go                              |  14 +-
 pkg/util/modeline/parser.go                        |   5 +-
 pkg/util/source/inspector.go                       |   2 +
 pkg/util/source/inspector_groovy.go                |   2 +
 pkg/util/source/inspector_groovy_test.go           |   9 ++
 pkg/util/source/inspector_java_script.go           |   2 +
 pkg/util/source/inspector_java_script_test.go      |   9 ++
 pkg/util/source/inspector_java_source.go           |   1 +
 pkg/util/source/inspector_java_source_test.go      |   9 ++
 pkg/util/source/inspector_kotlin.go                |   1 +
 pkg/util/source/inspector_kotlin_test.go           |   9 ++
 pkg/util/source/inspector_xml.go                   |   2 +-
 pkg/util/source/inspector_xml_test.go              |  13 ++
 pkg/util/source/inspector_yaml.go                  |   2 +-
 pkg/util/source/inspector_yaml_test.go             |  36 +++++
 37 files changed, 1068 insertions(+), 41 deletions(-)
 copy e2e/{knative/files/template-knative.yaml => common/traits/files/template-with-supplemental-groups.yaml} (89%)
 create mode 100644 examples/wiretap/README.md
 copy examples/{basic/Env.java => wiretap/WireTap.java} (82%)


[camel-k] 03/03: feat: add basic support for PodSecurityContext

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit c8803d8853c93d0d95b638d3e99987e8e3e674ab
Author: Adriano Machado <unknown>
AuthorDate: Mon Jun 6 10:31:23 2022 -0400

    feat: add basic support for PodSecurityContext
---
 addons/keda/duck/v1alpha1/zz_generated.deepcopy.go |   1 +
 .../strimzi/duck/v1beta2/zz_generated.deepcopy.go  |   1 +
 .../crd/bases/camel.apache.org_integrations.yaml   | 168 ++++++++++++++++++++
 .../bases/camel.apache.org_kameletbindings.yaml    | 172 +++++++++++++++++++++
 .../attachments/schema/integration-schema.json     | 105 ++++++++++++-
 docs/modules/ROOT/partials/apis/camel-k-crds.adoc  |  10 +-
 docs/modules/ROOT/partials/apis/crds-html.adoc     |  13 ++
 .../files/template-with-supplemental-groups.yaml   |  25 +++
 e2e/common/traits/pod_test.go                      |  83 +++++++---
 helm/camel-k/crds/crd-integration.yaml             | 168 ++++++++++++++++++++
 helm/camel-k/crds/crd-kamelet-binding.yaml         | 172 +++++++++++++++++++++
 pkg/apis/camel/v1/integration_types.go             |   2 +
 pkg/apis/camel/v1/zz_generated.deepcopy.go         |   2 +
 pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go   |   1 +
 pkg/cmd/run_test.go                                |  33 ++++
 .../integration/integration_controller.go          |   2 +-
 pkg/resources/resources.go                         |  14 +-
 pkg/trait/pod_test.go                              |  14 +-
 18 files changed, 956 insertions(+), 30 deletions(-)

diff --git a/addons/keda/duck/v1alpha1/zz_generated.deepcopy.go b/addons/keda/duck/v1alpha1/zz_generated.deepcopy.go
index 9762e390a..7bbeb3f44 100644
--- a/addons/keda/duck/v1alpha1/zz_generated.deepcopy.go
+++ b/addons/keda/duck/v1alpha1/zz_generated.deepcopy.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
 // +build !ignore_autogenerated
 
 // Code generated by controller-gen. DO NOT EDIT.
diff --git a/addons/strimzi/duck/v1beta2/zz_generated.deepcopy.go b/addons/strimzi/duck/v1beta2/zz_generated.deepcopy.go
index 6a7dd3b77..3a0464935 100644
--- a/addons/strimzi/duck/v1beta2/zz_generated.deepcopy.go
+++ b/addons/strimzi/duck/v1beta2/zz_generated.deepcopy.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
 // +build !ignore_autogenerated
 
 // Code generated by controller-gen. DO NOT EDIT.
diff --git a/config/crd/bases/camel.apache.org_integrations.yaml b/config/crd/bases/camel.apache.org_integrations.yaml
index c477a4534..42528332a 100644
--- a/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/config/crd/bases/camel.apache.org_integrations.yaml
@@ -3958,6 +3958,174 @@ spec:
                       restartPolicy:
                         description: RestartPolicy
                         type: string
+                      securityContext:
+                        description: PodSecurityContext
+                        properties:
+                          fsGroup:
+                            description: "A special supplemental group that applies
+                              to all containers in a pod. Some volume types allow
+                              the Kubelet to change the ownership of that volume to
+                              be owned by the pod: \n 1. The owning GID will be the
+                              FSGroup 2. The setgid bit is set (new files created
+                              in the volume will be owned by FSGroup) 3. The permission
+                              bits are OR'd with rw-rw---- \n If unset, the Kubelet
+                              will not modify the ownership and permissions of any
+                              volume."
+                            format: int64
+                            type: integer
+                          fsGroupChangePolicy:
+                            description: 'fsGroupChangePolicy defines behavior of
+                              changing ownership and permission of the volume before
+                              being exposed inside Pod. This field will only apply
+                              to volume types which support fsGroup based ownership(and
+                              permissions). It will have no effect on ephemeral volume
+                              types such as: secret, configmaps and emptydir. Valid
+                              values are "OnRootMismatch" and "Always". If not specified,
+                              "Always" is used.'
+                            type: string
+                          runAsGroup:
+                            description: The GID to run the entrypoint of the container
+                              process. Uses runtime default if unset. May also be
+                              set in SecurityContext.  If set in both SecurityContext
+                              and PodSecurityContext, the value specified in SecurityContext
+                              takes precedence for that container.
+                            format: int64
+                            type: integer
+                          runAsNonRoot:
+                            description: Indicates that the container must run as
+                              a non-root user. If true, the Kubelet will validate
+                              the image at runtime to ensure that it does not run
+                              as UID 0 (root) and fail to start the container if it
+                              does. If unset or false, no such validation will be
+                              performed. May also be set in SecurityContext.  If set
+                              in both SecurityContext and PodSecurityContext, the
+                              value specified in SecurityContext takes precedence.
+                            type: boolean
+                          runAsUser:
+                            description: The UID to run the entrypoint of the container
+                              process. Defaults to user specified in image metadata
+                              if unspecified. May also be set in SecurityContext.  If
+                              set in both SecurityContext and PodSecurityContext,
+                              the value specified in SecurityContext takes precedence
+                              for that container.
+                            format: int64
+                            type: integer
+                          seLinuxOptions:
+                            description: The SELinux context to be applied to all
+                              containers. If unspecified, the container runtime will
+                              allocate a random SELinux context for each container.  May
+                              also be set in SecurityContext.  If set in both SecurityContext
+                              and PodSecurityContext, the value specified in SecurityContext
+                              takes precedence for that container.
+                            properties:
+                              level:
+                                description: Level is SELinux level label that applies
+                                  to the container.
+                                type: string
+                              role:
+                                description: Role is a SELinux role label that applies
+                                  to the container.
+                                type: string
+                              type:
+                                description: Type is a SELinux type label that applies
+                                  to the container.
+                                type: string
+                              user:
+                                description: User is a SELinux user label that applies
+                                  to the container.
+                                type: string
+                            type: object
+                          seccompProfile:
+                            description: The seccomp options to use by the containers
+                              in this pod.
+                            properties:
+                              localhostProfile:
+                                description: localhostProfile indicates a profile
+                                  defined in a file on the node should be used. The
+                                  profile must be preconfigured on the node to work.
+                                  Must be a descending path, relative to the kubelet's
+                                  configured seccomp profile location. Must only be
+                                  set if type is "Localhost".
+                                type: string
+                              type:
+                                description: "type indicates which kind of seccomp
+                                  profile will be applied. Valid options are: \n Localhost
+                                  - a profile defined in a file on the node should
+                                  be used. RuntimeDefault - the container runtime
+                                  default profile should be used. Unconfined - no
+                                  profile should be applied."
+                                type: string
+                            required:
+                            - type
+                            type: object
+                          supplementalGroups:
+                            description: A list of groups applied to the first process
+                              run in each container, in addition to the container's
+                              primary GID.  If unspecified, no groups will be added
+                              to any container.
+                            items:
+                              format: int64
+                              type: integer
+                            type: array
+                          sysctls:
+                            description: Sysctls hold a list of namespaced sysctls
+                              used for the pod. Pods with unsupported sysctls (by
+                              the container runtime) might fail to launch.
+                            items:
+                              description: Sysctl defines a kernel parameter to be
+                                set
+                              properties:
+                                name:
+                                  description: Name of a property to set
+                                  type: string
+                                value:
+                                  description: Value of a property to set
+                                  type: string
+                              required:
+                              - name
+                              - value
+                              type: object
+                            type: array
+                          windowsOptions:
+                            description: The Windows specific settings applied to
+                              all containers. If unspecified, the options within a
+                              container's SecurityContext will be used. If set in
+                              both SecurityContext and PodSecurityContext, the value
+                              specified in SecurityContext takes precedence.
+                            properties:
+                              gmsaCredentialSpec:
+                                description: GMSACredentialSpec is where the GMSA
+                                  admission webhook (https://github.com/kubernetes-sigs/windows-gmsa)
+                                  inlines the contents of the GMSA credential spec
+                                  named by the GMSACredentialSpecName field.
+                                type: string
+                              gmsaCredentialSpecName:
+                                description: GMSACredentialSpecName is the name of
+                                  the GMSA credential spec to use.
+                                type: string
+                              hostProcess:
+                                description: HostProcess determines if a container
+                                  should be run as a 'Host Process' container. This
+                                  field is alpha-level and will only be honored by
+                                  components that enable the WindowsHostProcessContainers
+                                  feature flag. Setting this field without the feature
+                                  flag will result in errors when validating the Pod.
+                                  All of a Pod's containers must have the same effective
+                                  HostProcess value (it is not allowed to have a mix
+                                  of HostProcess containers and non-HostProcess containers).  In
+                                  addition, if HostProcess is true then HostNetwork
+                                  must also be set to true.
+                                type: boolean
+                              runAsUserName:
+                                description: The UserName in Windows to run the entrypoint
+                                  of the container process. Defaults to the user specified
+                                  in image metadata if unspecified. May also be set
+                                  in PodSecurityContext. If set in both SecurityContext
+                                  and PodSecurityContext, the value specified in SecurityContext
+                                  takes precedence.
+                                type: string
+                            type: object
+                        type: object
                       terminationGracePeriodSeconds:
                         description: TerminationGracePeriodSeconds
                         format: int64
diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml
index f02dfc036..13b8a20b5 100644
--- a/config/crd/bases/camel.apache.org_kameletbindings.yaml
+++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml
@@ -4150,6 +4150,178 @@ spec:
                           restartPolicy:
                             description: RestartPolicy
                             type: string
+                          securityContext:
+                            description: PodSecurityContext
+                            properties:
+                              fsGroup:
+                                description: "A special supplemental group that applies
+                                  to all containers in a pod. Some volume types allow
+                                  the Kubelet to change the ownership of that volume
+                                  to be owned by the pod: \n 1. The owning GID will
+                                  be the FSGroup 2. The setgid bit is set (new files
+                                  created in the volume will be owned by FSGroup)
+                                  3. The permission bits are OR'd with rw-rw---- \n
+                                  If unset, the Kubelet will not modify the ownership
+                                  and permissions of any volume."
+                                format: int64
+                                type: integer
+                              fsGroupChangePolicy:
+                                description: 'fsGroupChangePolicy defines behavior
+                                  of changing ownership and permission of the volume
+                                  before being exposed inside Pod. This field will
+                                  only apply to volume types which support fsGroup
+                                  based ownership(and permissions). It will have no
+                                  effect on ephemeral volume types such as: secret,
+                                  configmaps and emptydir. Valid values are "OnRootMismatch"
+                                  and "Always". If not specified, "Always" is used.'
+                                type: string
+                              runAsGroup:
+                                description: The GID to run the entrypoint of the
+                                  container process. Uses runtime default if unset.
+                                  May also be set in SecurityContext.  If set in both
+                                  SecurityContext and PodSecurityContext, the value
+                                  specified in SecurityContext takes precedence for
+                                  that container.
+                                format: int64
+                                type: integer
+                              runAsNonRoot:
+                                description: Indicates that the container must run
+                                  as a non-root user. If true, the Kubelet will validate
+                                  the image at runtime to ensure that it does not
+                                  run as UID 0 (root) and fail to start the container
+                                  if it does. If unset or false, no such validation
+                                  will be performed. May also be set in SecurityContext.  If
+                                  set in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence.
+                                type: boolean
+                              runAsUser:
+                                description: The UID to run the entrypoint of the
+                                  container process. Defaults to user specified in
+                                  image metadata if unspecified. May also be set in
+                                  SecurityContext.  If set in both SecurityContext
+                                  and PodSecurityContext, the value specified in SecurityContext
+                                  takes precedence for that container.
+                                format: int64
+                                type: integer
+                              seLinuxOptions:
+                                description: The SELinux context to be applied to
+                                  all containers. If unspecified, the container runtime
+                                  will allocate a random SELinux context for each
+                                  container.  May also be set in SecurityContext.  If
+                                  set in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence
+                                  for that container.
+                                properties:
+                                  level:
+                                    description: Level is SELinux level label that
+                                      applies to the container.
+                                    type: string
+                                  role:
+                                    description: Role is a SELinux role label that
+                                      applies to the container.
+                                    type: string
+                                  type:
+                                    description: Type is a SELinux type label that
+                                      applies to the container.
+                                    type: string
+                                  user:
+                                    description: User is a SELinux user label that
+                                      applies to the container.
+                                    type: string
+                                type: object
+                              seccompProfile:
+                                description: The seccomp options to use by the containers
+                                  in this pod.
+                                properties:
+                                  localhostProfile:
+                                    description: localhostProfile indicates a profile
+                                      defined in a file on the node should be used.
+                                      The profile must be preconfigured on the node
+                                      to work. Must be a descending path, relative
+                                      to the kubelet's configured seccomp profile
+                                      location. Must only be set if type is "Localhost".
+                                    type: string
+                                  type:
+                                    description: "type indicates which kind of seccomp
+                                      profile will be applied. Valid options are:
+                                      \n Localhost - a profile defined in a file on
+                                      the node should be used. RuntimeDefault - the
+                                      container runtime default profile should be
+                                      used. Unconfined - no profile should be applied."
+                                    type: string
+                                required:
+                                - type
+                                type: object
+                              supplementalGroups:
+                                description: A list of groups applied to the first
+                                  process run in each container, in addition to the
+                                  container's primary GID.  If unspecified, no groups
+                                  will be added to any container.
+                                items:
+                                  format: int64
+                                  type: integer
+                                type: array
+                              sysctls:
+                                description: Sysctls hold a list of namespaced sysctls
+                                  used for the pod. Pods with unsupported sysctls
+                                  (by the container runtime) might fail to launch.
+                                items:
+                                  description: Sysctl defines a kernel parameter to
+                                    be set
+                                  properties:
+                                    name:
+                                      description: Name of a property to set
+                                      type: string
+                                    value:
+                                      description: Value of a property to set
+                                      type: string
+                                  required:
+                                  - name
+                                  - value
+                                  type: object
+                                type: array
+                              windowsOptions:
+                                description: The Windows specific settings applied
+                                  to all containers. If unspecified, the options within
+                                  a container's SecurityContext will be used. If set
+                                  in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence.
+                                properties:
+                                  gmsaCredentialSpec:
+                                    description: GMSACredentialSpec is where the GMSA
+                                      admission webhook (https://github.com/kubernetes-sigs/windows-gmsa)
+                                      inlines the contents of the GMSA credential
+                                      spec named by the GMSACredentialSpecName field.
+                                    type: string
+                                  gmsaCredentialSpecName:
+                                    description: GMSACredentialSpecName is the name
+                                      of the GMSA credential spec to use.
+                                    type: string
+                                  hostProcess:
+                                    description: HostProcess determines if a container
+                                      should be run as a 'Host Process' container.
+                                      This field is alpha-level and will only be honored
+                                      by components that enable the WindowsHostProcessContainers
+                                      feature flag. Setting this field without the
+                                      feature flag will result in errors when validating
+                                      the Pod. All of a Pod's containers must have
+                                      the same effective HostProcess value (it is
+                                      not allowed to have a mix of HostProcess containers
+                                      and non-HostProcess containers).  In addition,
+                                      if HostProcess is true then HostNetwork must
+                                      also be set to true.
+                                    type: boolean
+                                  runAsUserName:
+                                    description: The UserName in Windows to run the
+                                      entrypoint of the container process. Defaults
+                                      to the user specified in image metadata if unspecified.
+                                      May also be set in PodSecurityContext. If set
+                                      in both SecurityContext and PodSecurityContext,
+                                      the value specified in SecurityContext takes
+                                      precedence.
+                                    type: string
+                                type: object
+                            type: object
                           terminationGracePeriodSeconds:
                             description: TerminationGracePeriodSeconds
                             format: int64
diff --git a/docs/modules/ROOT/attachments/schema/integration-schema.json b/docs/modules/ROOT/attachments/schema/integration-schema.json
index 186329956..c1117d555 100644
--- a/docs/modules/ROOT/attachments/schema/integration-schema.json
+++ b/docs/modules/ROOT/attachments/schema/integration-schema.json
@@ -3392,6 +3392,109 @@
                   "description": "RestartPolicy describes how the container should be restarted. Only one of the following restart policies may be specified. If none of the following policies is specified, the default one is RestartPolicyAlways.",
                   "type": "string"
                 },
+                "securityContext": {
+                  "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext.  Field values of container.securityContext take precedence over field values of PodSecurityContext.",
+                  "properties": {
+                    "fsGroup": {
+                      "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.",
+                      "format": "int64",
+                      "type": "integer"
+                    },
+                    "fsGroupChangePolicy": {
+                      "description": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified defaults to \"Always\".",
+                      "type": "string"
+                    },
+                    "runAsGroup": {
+                      "description": "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                      "format": "int64",
+                      "type": "integer"
+                    },
+                    "runAsNonRoot": {
+                      "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                      "type": "boolean"
+                    },
+                    "runAsUser": {
+                      "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                      "format": "int64",
+                      "type": "integer"
+                    },
+                    "seLinuxOptions": {
+                      "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container.  May also be set in PodSecurityContext.  If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                      "properties": {
+                        "level": {
+                          "description": "Level is SELinux level label that applies to the container.",
+                          "type": "string"
+                        },
+                        "role": {
+                          "description": "Role is a SELinux role label that applies to the container.",
+                          "type": "string"
+                        },
+                        "type": {
+                          "description": "Type is a SELinux type label that applies to the container.",
+                          "type": "string"
+                        },
+                        "user": {
+                          "description": "User is a SELinux user label that applies to the container.",
+                          "type": "string"
+                        }
+                      },
+                      "type": "object"
+                    },
+                    "supplementalGroups": {
+                      "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.",
+                      "items": {
+                        "format": "int64",
+                        "type": "integer"
+                      },
+                      "type": "array"
+                    },
+                    "sysctls": {
+                      "description": "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.",
+                      "items": {
+                        "description": "Sysctl defines a kernel parameter to be set",
+                        "properties": {
+                          "name": {
+                            "description": "Name of a property to set",
+                            "type": "string"
+                          },
+                          "value": {
+                            "description": "Value of a property to set",
+                            "type": "string"
+                          }
+                        },
+                        "required": [
+                          "name",
+                          "value"
+                        ],
+                        "type": "object"
+                      },
+                      "type": "array"
+                    },
+                    "windowsOptions": {
+                      "description": "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                      "properties": {
+                        "gmsaCredentialSpec": {
+                          "description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.",
+                          "type": "string"
+                        },
+                        "gmsaCredentialSpecName": {
+                          "description": "GMSACredentialSpecName is the name of the GMSA credential spec to use.",
+                          "type": "string"
+                        },
+                        "hostProcess": {
+                          "description": "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess  [...]
+                          "type": "boolean"
+                        },
+                        "runAsUserName": {
+                          "description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.",
+                          "type": "string"
+                        }
+                      },
+                      "type": "object"
+                    }
+                  },
+                  "type": "object"
+                },
                 "serviceAccount": {
                   "type": "string"
                 },
@@ -9269,4 +9372,4 @@
       }
     }
   }
-}
\ No newline at end of file
+}
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index f2bd9a4dc..f770369f6 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -2458,6 +2458,14 @@ NodeSelector
 TopologySpreadConstraints
 
 
+|`securityContext` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#podsecuritycontext-v1-core[[\]Kubernetes core/v1.PodSecurityContext]*
+|
+
+
+PodSecurityContext
+
+
 |===
 
 [#_camel_apache_org_v1_PodSpecTemplate]
@@ -3106,4 +3114,4 @@ Selects a key of a ConfigMap.
 Selects a key of a secret.
 
 
-|===
\ No newline at end of file
+|===
diff --git a/docs/modules/ROOT/partials/apis/crds-html.adoc b/docs/modules/ROOT/partials/apis/crds-html.adoc
index 8c91fbb64..3a4dadc90 100644
--- a/docs/modules/ROOT/partials/apis/crds-html.adoc
+++ b/docs/modules/ROOT/partials/apis/crds-html.adoc
@@ -3910,6 +3910,19 @@ map[string]string
 <td>
 </td>
 </tr>
+<tr>
+<td>
+<code>securityContext</code><br/>
+<em>
+<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#podsecuritycontext-v1-core">
+[]Kubernetes core/v1.PodSecurityContext
+</a>
+</em>
+</td>
+<td>
+PodSecurityContext
+</td>
+</tr>
 </tbody>
 </table>
 <h3 id="camel.apache.org/v1.PodSpecTemplate">PodSpecTemplate
diff --git a/e2e/common/traits/files/template-with-supplemental-groups.yaml b/e2e/common/traits/files/template-with-supplemental-groups.yaml
new file mode 100644
index 000000000..fdb1c034b
--- /dev/null
+++ b/e2e/common/traits/files/template-with-supplemental-groups.yaml
@@ -0,0 +1,25 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+containers:
+  - name: integration
+    env:
+      - name: TEST_VARIABLE
+        value: "hello from the template"
+securityContext:
+  supplementalGroups:
+    - 666
diff --git a/e2e/common/traits/pod_test.go b/e2e/common/traits/pod_test.go
index 1fa802505..3f12895bd 100644
--- a/e2e/common/traits/pod_test.go
+++ b/e2e/common/traits/pod_test.go
@@ -34,27 +34,72 @@ import (
 )
 
 func TestPodTrait(t *testing.T) {
+
+	tc := []struct {
+		name         string
+		templateName string
+		assertions   func(t *testing.T, ns string, name string)
+	}{
+		{
+			name:         "pod trait with env vars and volume mounts",
+			templateName: "files/template.yaml",
+			// nolint: thelper
+			assertions: func(t *testing.T, ns string, name string) {
+				// check that integrations is working and reading data created by sidecar container
+				Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Content from the sidecar container"))
+				// check that env var is injected
+				Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("hello from the template"))
+				pod := IntegrationPod(ns, name)()
+
+				// check if ENV variable is applied
+				envValue := getEnvVar("TEST_VARIABLE", pod.Spec)
+				Expect(envValue).To(Equal("hello from the template"))
+			},
+		},
+		{
+			name:         "pod trait with supplemental groups",
+			templateName: "files/template-with-supplemental-groups.yaml",
+			// nolint: thelper
+			assertions: func(t *testing.T, ns string, name string) {
+				Eventually(IntegrationPodHas(ns, name, func(pod *corev1.Pod) bool {
+					if pod.Spec.SecurityContext == nil {
+						return false
+					}
+					for _, sg := range pod.Spec.SecurityContext.SupplementalGroups {
+						if sg == 666 {
+							return true
+						}
+					}
+					return false
+				}), TestTimeoutShort).Should(BeTrue())
+			},
+		},
+	}
+
 	WithNewTestNamespace(t, func(ns string) {
-		name := "pod-template-test"
 		Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
-		Expect(Kamel("run", "-n", ns, "files/PodTest.groovy",
-			"--name", name,
-			"--pod-template", "files/template.yaml",
-		).Execute()).To(Succeed())
-
-		// check integration is deployed
-		Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
-		Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
-
-		// check that integrations is working and reading data created by sidecar container
-		Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Content from the sidecar container"))
-		// check that env var is injected
-		Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("hello from the template"))
-		pod := IntegrationPod(ns, name)()
-
-		// check if ENV variable is applied
-		envValue := getEnvVar("TEST_VARIABLE", pod.Spec)
-		Expect(envValue).To(Equal("hello from the template"))
+
+		name := "pod-template-test"
+
+		for i := range tc {
+			test := tc[i]
+
+			t.Run(test.name, func(t *testing.T) {
+				Expect(Kamel("run", "-n", ns, "files/PodTest.groovy",
+					"--name", name,
+					"--pod-template", test.templateName,
+				).Execute()).To(Succeed())
+
+				// check integration is deployed
+				Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+				Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+
+				test.assertions(t, ns, name)
+
+				// Clean up
+				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+			})
+		}
 	})
 }
 
diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml
index c477a4534..42528332a 100644
--- a/helm/camel-k/crds/crd-integration.yaml
+++ b/helm/camel-k/crds/crd-integration.yaml
@@ -3958,6 +3958,174 @@ spec:
                       restartPolicy:
                         description: RestartPolicy
                         type: string
+                      securityContext:
+                        description: PodSecurityContext
+                        properties:
+                          fsGroup:
+                            description: "A special supplemental group that applies
+                              to all containers in a pod. Some volume types allow
+                              the Kubelet to change the ownership of that volume to
+                              be owned by the pod: \n 1. The owning GID will be the
+                              FSGroup 2. The setgid bit is set (new files created
+                              in the volume will be owned by FSGroup) 3. The permission
+                              bits are OR'd with rw-rw---- \n If unset, the Kubelet
+                              will not modify the ownership and permissions of any
+                              volume."
+                            format: int64
+                            type: integer
+                          fsGroupChangePolicy:
+                            description: 'fsGroupChangePolicy defines behavior of
+                              changing ownership and permission of the volume before
+                              being exposed inside Pod. This field will only apply
+                              to volume types which support fsGroup based ownership(and
+                              permissions). It will have no effect on ephemeral volume
+                              types such as: secret, configmaps and emptydir. Valid
+                              values are "OnRootMismatch" and "Always". If not specified,
+                              "Always" is used.'
+                            type: string
+                          runAsGroup:
+                            description: The GID to run the entrypoint of the container
+                              process. Uses runtime default if unset. May also be
+                              set in SecurityContext.  If set in both SecurityContext
+                              and PodSecurityContext, the value specified in SecurityContext
+                              takes precedence for that container.
+                            format: int64
+                            type: integer
+                          runAsNonRoot:
+                            description: Indicates that the container must run as
+                              a non-root user. If true, the Kubelet will validate
+                              the image at runtime to ensure that it does not run
+                              as UID 0 (root) and fail to start the container if it
+                              does. If unset or false, no such validation will be
+                              performed. May also be set in SecurityContext.  If set
+                              in both SecurityContext and PodSecurityContext, the
+                              value specified in SecurityContext takes precedence.
+                            type: boolean
+                          runAsUser:
+                            description: The UID to run the entrypoint of the container
+                              process. Defaults to user specified in image metadata
+                              if unspecified. May also be set in SecurityContext.  If
+                              set in both SecurityContext and PodSecurityContext,
+                              the value specified in SecurityContext takes precedence
+                              for that container.
+                            format: int64
+                            type: integer
+                          seLinuxOptions:
+                            description: The SELinux context to be applied to all
+                              containers. If unspecified, the container runtime will
+                              allocate a random SELinux context for each container.  May
+                              also be set in SecurityContext.  If set in both SecurityContext
+                              and PodSecurityContext, the value specified in SecurityContext
+                              takes precedence for that container.
+                            properties:
+                              level:
+                                description: Level is SELinux level label that applies
+                                  to the container.
+                                type: string
+                              role:
+                                description: Role is a SELinux role label that applies
+                                  to the container.
+                                type: string
+                              type:
+                                description: Type is a SELinux type label that applies
+                                  to the container.
+                                type: string
+                              user:
+                                description: User is a SELinux user label that applies
+                                  to the container.
+                                type: string
+                            type: object
+                          seccompProfile:
+                            description: The seccomp options to use by the containers
+                              in this pod.
+                            properties:
+                              localhostProfile:
+                                description: localhostProfile indicates a profile
+                                  defined in a file on the node should be used. The
+                                  profile must be preconfigured on the node to work.
+                                  Must be a descending path, relative to the kubelet's
+                                  configured seccomp profile location. Must only be
+                                  set if type is "Localhost".
+                                type: string
+                              type:
+                                description: "type indicates which kind of seccomp
+                                  profile will be applied. Valid options are: \n Localhost
+                                  - a profile defined in a file on the node should
+                                  be used. RuntimeDefault - the container runtime
+                                  default profile should be used. Unconfined - no
+                                  profile should be applied."
+                                type: string
+                            required:
+                            - type
+                            type: object
+                          supplementalGroups:
+                            description: A list of groups applied to the first process
+                              run in each container, in addition to the container's
+                              primary GID.  If unspecified, no groups will be added
+                              to any container.
+                            items:
+                              format: int64
+                              type: integer
+                            type: array
+                          sysctls:
+                            description: Sysctls hold a list of namespaced sysctls
+                              used for the pod. Pods with unsupported sysctls (by
+                              the container runtime) might fail to launch.
+                            items:
+                              description: Sysctl defines a kernel parameter to be
+                                set
+                              properties:
+                                name:
+                                  description: Name of a property to set
+                                  type: string
+                                value:
+                                  description: Value of a property to set
+                                  type: string
+                              required:
+                              - name
+                              - value
+                              type: object
+                            type: array
+                          windowsOptions:
+                            description: The Windows specific settings applied to
+                              all containers. If unspecified, the options within a
+                              container's SecurityContext will be used. If set in
+                              both SecurityContext and PodSecurityContext, the value
+                              specified in SecurityContext takes precedence.
+                            properties:
+                              gmsaCredentialSpec:
+                                description: GMSACredentialSpec is where the GMSA
+                                  admission webhook (https://github.com/kubernetes-sigs/windows-gmsa)
+                                  inlines the contents of the GMSA credential spec
+                                  named by the GMSACredentialSpecName field.
+                                type: string
+                              gmsaCredentialSpecName:
+                                description: GMSACredentialSpecName is the name of
+                                  the GMSA credential spec to use.
+                                type: string
+                              hostProcess:
+                                description: HostProcess determines if a container
+                                  should be run as a 'Host Process' container. This
+                                  field is alpha-level and will only be honored by
+                                  components that enable the WindowsHostProcessContainers
+                                  feature flag. Setting this field without the feature
+                                  flag will result in errors when validating the Pod.
+                                  All of a Pod's containers must have the same effective
+                                  HostProcess value (it is not allowed to have a mix
+                                  of HostProcess containers and non-HostProcess containers).  In
+                                  addition, if HostProcess is true then HostNetwork
+                                  must also be set to true.
+                                type: boolean
+                              runAsUserName:
+                                description: The UserName in Windows to run the entrypoint
+                                  of the container process. Defaults to the user specified
+                                  in image metadata if unspecified. May also be set
+                                  in PodSecurityContext. If set in both SecurityContext
+                                  and PodSecurityContext, the value specified in SecurityContext
+                                  takes precedence.
+                                type: string
+                            type: object
+                        type: object
                       terminationGracePeriodSeconds:
                         description: TerminationGracePeriodSeconds
                         format: int64
diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml
index f02dfc036..13b8a20b5 100644
--- a/helm/camel-k/crds/crd-kamelet-binding.yaml
+++ b/helm/camel-k/crds/crd-kamelet-binding.yaml
@@ -4150,6 +4150,178 @@ spec:
                           restartPolicy:
                             description: RestartPolicy
                             type: string
+                          securityContext:
+                            description: PodSecurityContext
+                            properties:
+                              fsGroup:
+                                description: "A special supplemental group that applies
+                                  to all containers in a pod. Some volume types allow
+                                  the Kubelet to change the ownership of that volume
+                                  to be owned by the pod: \n 1. The owning GID will
+                                  be the FSGroup 2. The setgid bit is set (new files
+                                  created in the volume will be owned by FSGroup)
+                                  3. The permission bits are OR'd with rw-rw---- \n
+                                  If unset, the Kubelet will not modify the ownership
+                                  and permissions of any volume."
+                                format: int64
+                                type: integer
+                              fsGroupChangePolicy:
+                                description: 'fsGroupChangePolicy defines behavior
+                                  of changing ownership and permission of the volume
+                                  before being exposed inside Pod. This field will
+                                  only apply to volume types which support fsGroup
+                                  based ownership(and permissions). It will have no
+                                  effect on ephemeral volume types such as: secret,
+                                  configmaps and emptydir. Valid values are "OnRootMismatch"
+                                  and "Always". If not specified, "Always" is used.'
+                                type: string
+                              runAsGroup:
+                                description: The GID to run the entrypoint of the
+                                  container process. Uses runtime default if unset.
+                                  May also be set in SecurityContext.  If set in both
+                                  SecurityContext and PodSecurityContext, the value
+                                  specified in SecurityContext takes precedence for
+                                  that container.
+                                format: int64
+                                type: integer
+                              runAsNonRoot:
+                                description: Indicates that the container must run
+                                  as a non-root user. If true, the Kubelet will validate
+                                  the image at runtime to ensure that it does not
+                                  run as UID 0 (root) and fail to start the container
+                                  if it does. If unset or false, no such validation
+                                  will be performed. May also be set in SecurityContext.  If
+                                  set in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence.
+                                type: boolean
+                              runAsUser:
+                                description: The UID to run the entrypoint of the
+                                  container process. Defaults to user specified in
+                                  image metadata if unspecified. May also be set in
+                                  SecurityContext.  If set in both SecurityContext
+                                  and PodSecurityContext, the value specified in SecurityContext
+                                  takes precedence for that container.
+                                format: int64
+                                type: integer
+                              seLinuxOptions:
+                                description: The SELinux context to be applied to
+                                  all containers. If unspecified, the container runtime
+                                  will allocate a random SELinux context for each
+                                  container.  May also be set in SecurityContext.  If
+                                  set in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence
+                                  for that container.
+                                properties:
+                                  level:
+                                    description: Level is SELinux level label that
+                                      applies to the container.
+                                    type: string
+                                  role:
+                                    description: Role is a SELinux role label that
+                                      applies to the container.
+                                    type: string
+                                  type:
+                                    description: Type is a SELinux type label that
+                                      applies to the container.
+                                    type: string
+                                  user:
+                                    description: User is a SELinux user label that
+                                      applies to the container.
+                                    type: string
+                                type: object
+                              seccompProfile:
+                                description: The seccomp options to use by the containers
+                                  in this pod.
+                                properties:
+                                  localhostProfile:
+                                    description: localhostProfile indicates a profile
+                                      defined in a file on the node should be used.
+                                      The profile must be preconfigured on the node
+                                      to work. Must be a descending path, relative
+                                      to the kubelet's configured seccomp profile
+                                      location. Must only be set if type is "Localhost".
+                                    type: string
+                                  type:
+                                    description: "type indicates which kind of seccomp
+                                      profile will be applied. Valid options are:
+                                      \n Localhost - a profile defined in a file on
+                                      the node should be used. RuntimeDefault - the
+                                      container runtime default profile should be
+                                      used. Unconfined - no profile should be applied."
+                                    type: string
+                                required:
+                                - type
+                                type: object
+                              supplementalGroups:
+                                description: A list of groups applied to the first
+                                  process run in each container, in addition to the
+                                  container's primary GID.  If unspecified, no groups
+                                  will be added to any container.
+                                items:
+                                  format: int64
+                                  type: integer
+                                type: array
+                              sysctls:
+                                description: Sysctls hold a list of namespaced sysctls
+                                  used for the pod. Pods with unsupported sysctls
+                                  (by the container runtime) might fail to launch.
+                                items:
+                                  description: Sysctl defines a kernel parameter to
+                                    be set
+                                  properties:
+                                    name:
+                                      description: Name of a property to set
+                                      type: string
+                                    value:
+                                      description: Value of a property to set
+                                      type: string
+                                  required:
+                                  - name
+                                  - value
+                                  type: object
+                                type: array
+                              windowsOptions:
+                                description: The Windows specific settings applied
+                                  to all containers. If unspecified, the options within
+                                  a container's SecurityContext will be used. If set
+                                  in both SecurityContext and PodSecurityContext,
+                                  the value specified in SecurityContext takes precedence.
+                                properties:
+                                  gmsaCredentialSpec:
+                                    description: GMSACredentialSpec is where the GMSA
+                                      admission webhook (https://github.com/kubernetes-sigs/windows-gmsa)
+                                      inlines the contents of the GMSA credential
+                                      spec named by the GMSACredentialSpecName field.
+                                    type: string
+                                  gmsaCredentialSpecName:
+                                    description: GMSACredentialSpecName is the name
+                                      of the GMSA credential spec to use.
+                                    type: string
+                                  hostProcess:
+                                    description: HostProcess determines if a container
+                                      should be run as a 'Host Process' container.
+                                      This field is alpha-level and will only be honored
+                                      by components that enable the WindowsHostProcessContainers
+                                      feature flag. Setting this field without the
+                                      feature flag will result in errors when validating
+                                      the Pod. All of a Pod's containers must have
+                                      the same effective HostProcess value (it is
+                                      not allowed to have a mix of HostProcess containers
+                                      and non-HostProcess containers).  In addition,
+                                      if HostProcess is true then HostNetwork must
+                                      also be set to true.
+                                    type: boolean
+                                  runAsUserName:
+                                    description: The UserName in Windows to run the
+                                      entrypoint of the container process. Defaults
+                                      to the user specified in image metadata if unspecified.
+                                      May also be set in PodSecurityContext. If set
+                                      in both SecurityContext and PodSecurityContext,
+                                      the value specified in SecurityContext takes
+                                      precedence.
+                                    type: string
+                                type: object
+                            type: object
                           terminationGracePeriodSeconds:
                             description: TerminationGracePeriodSeconds
                             format: int64
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index 2caa83d52..12ef9822b 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -295,4 +295,6 @@ type PodSpec struct {
 	NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
 	// TopologySpreadConstraints
 	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey" protobuf:"bytes,33,opt,name=topologySpreadConstraints"`
+	// PodSecurityContext
+	SecurityContext corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,34,opt,name=securityContext"`
 }
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index b1f04c1f6..f01175b95 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
 // +build !ignore_autogenerated
 
 // Code generated by controller-gen. DO NOT EDIT.
@@ -1380,6 +1381,7 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) {
 			(*in)[i].DeepCopyInto(&(*out)[i])
 		}
 	}
+	in.SecurityContext.DeepCopyInto(&out.SecurityContext)
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpec.
diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
index b2148b9e2..e760a6b42 100644
--- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
 // +build !ignore_autogenerated
 
 // Code generated by controller-gen. DO NOT EDIT.
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index b865fb7ce..fc8f8dc78 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -680,3 +680,36 @@ func TestMissingTrait(t *testing.T) {
 	assert.Equal(t, "Error: bogus.fail=i-must-fail is not a valid trait property\n", output)
 	assert.NotNil(t, err)
 }
+
+func TestResolveYamlPodTemplateWithSupplementalGroups(t *testing.T) {
+	_, rootCmd, _ := initializeRunCmdOptions(t)
+	templateText := `
+securityContext:
+  supplementalGroups:
+    - 666
+`
+	integrationSpec := v1.IntegrationSpec{}
+	err := resolvePodTemplate(context.TODO(), rootCmd, templateText, &integrationSpec)
+	assert.Nil(t, err)
+	assert.NotNil(t, integrationSpec.PodTemplate)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec.SecurityContext)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups)
+	assert.Equal(t, 1, len(integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups))
+	assert.Contains(t, integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups, int64(666))
+}
+
+func TestResolveJsonPodTemplateWithSupplementalGroups(t *testing.T) {
+	_, rootCmd, _ := initializeRunCmdOptions(t)
+	minifiedYamlTemplate := `{"securityContext":{"supplementalGroups":[666]}}`
+
+	integrationSpec := v1.IntegrationSpec{}
+	err := resolvePodTemplate(context.TODO(), rootCmd, minifiedYamlTemplate, &integrationSpec)
+	assert.Nil(t, err)
+	assert.NotNil(t, integrationSpec.PodTemplate)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec.SecurityContext)
+	assert.NotNil(t, integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups)
+	assert.Equal(t, 1, len(integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups))
+	assert.Contains(t, integrationSpec.PodTemplate.Spec.SecurityContext.SupplementalGroups, int64(666))
+}
diff --git a/pkg/controller/integration/integration_controller.go b/pkg/controller/integration/integration_controller.go
index 4700c48d6..acd9bfa55 100644
--- a/pkg/controller/integration/integration_controller.go
+++ b/pkg/controller/integration/integration_controller.go
@@ -252,7 +252,7 @@ type reconcileIntegration struct {
 	recorder record.EventRecorder
 }
 
-// Reconcile reads that state of the cluster for a Integration object and makes changes based on the state read
+// Reconcile reads that state of the cluster for an Integration object and makes changes based on the state read
 // and what is in the Integration.Spec
 // Note:
 // The Controller will requeue the Request to be processed again if the returned error is non-nil or
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index 467c398d4..de93e2be8 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -145,16 +145,16 @@ var assets = func() http.FileSystem {
 		"/crd/bases/camel.apache.org_integrations.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "camel.apache.org_integrations.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 391718,
+			uncompressedSize: 402639,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x6b\x73\x1b\x37\xb6\x28\xfa\xdd\xbf\x02\x25\xa7\x8e\xa4\x1d\x91\xb2\x33\x73\xa6\xf6\xf8\x4e\x9d\x94\xb6\x24\x27\xba\xb1\x65\x96\xa5\x24\x27\xe5\x78\x12\xb0\x1b\x24\x71\xd4\x04\x7a\x00\x34\x25\xee\xeb\xfb\xdf\x6f\x61\x01\xe8\x07\x5f\xbd\xd0\x12\x1d\x67\x6e\x63\xaa\x26\x26\xc5\x5e\x8d\xc7\xc2\x7a\x3f\x9e\x93\xc1\xd3\x8d\x67\xcf\xc9\x1b\x9e\x30\xa1\x59\x4a\x8c\x24\x66\xc6\xc8\x59\x4e\x93\x19\x23\x37\x72\x62\xee\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x6b\x73\x1b\x37\xb6\x28\xfa\xdd\xbf\x02\x25\xa7\x8e\xa4\x1d\x91\xb2\x33\x73\xa6\xf6\xf8\x4e\x9d\x94\xb6\x24\x27\xba\xb1\x65\x96\xa5\x24\x27\xe5\x78\x12\xb0\x1b\x24\x71\xd4\x04\x7a\x00\x34\x25\xee\xeb\xfb\xdf\x6f\x61\x01\xe8\x07\x5f\xbd\xd0\x12\x1d\x67\x6e\x63\xaa\x26\x26\xc5\x5e\x8d\xc7\xc2\x7a\x3f\x9e\x93\xc1\xd3\x8d\x67\xcf\xc9\x1b\x9e\x30\xa1\x59\x4a\x8c\x24\x66\xc6\xc8\x59\x4e\x93\x19\x23\x37\x72\x62\xee\x [...]
 		},
 		"/crd/bases/camel.apache.org_kameletbindings.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "camel.apache.org_kameletbindings.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 458195,
+			uncompressedSize: 469932,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\xfd\x73\x1b\x37\xb2\x2f\x8c\xff\xee\xbf\x02\x25\xa7\xae\xa4\x13\x92\xb2\xb3\xbb\xa9\xb3\xfe\x6e\xdd\x94\x56\x96\x13\x7d\x63\xcb\x2c\x4b\x71\x6e\xca\xc9\x49\xc0\x19\x90\xc4\xd5\x10\x98\x05\x30\x94\xb8\x8f\x9f\xff\xfd\x29\x34\x80\x79\xe1\x9b\xd0\x43\x51\x51\x36\x83\x53\x75\x36\x92\x35\x3d\x18\x00\xdd\xe8\xee\x4f\xbf\x3c\x27\xfd\x87\x1b\xcf\x9e\x93\xb7\x3c\x61\x42\xb3\x94\x18\x49\xcc\x94\x91\xd3\x9c\x26\x53\x46\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\xfd\x73\x1b\x37\xb2\x2f\x8c\xff\xee\xbf\x02\x25\xa7\xae\xa4\x13\x92\xb2\xb3\xbb\xa9\xb3\xfe\x6e\xdd\x94\x56\x96\x13\x7d\x63\xcb\x2c\x4b\x71\x6e\xca\xc9\x49\xc0\x19\x90\xc4\xd5\x10\x98\x05\x30\x94\xb8\x8f\x9f\xff\xfd\x29\x34\x80\x79\xe1\x9b\xd0\x43\x51\x51\x36\x83\x53\x75\x36\x92\x35\x3d\x18\x00\xdd\xe8\xee\x4f\xbf\x3c\x27\xfd\x87\x1b\xcf\x9e\x93\xb7\x3c\x61\x42\xb3\x94\x18\x49\xcc\x94\x91\xd3\x9c\x26\x53\x46\x [...]
 		},
 		"/crd/bases/camel.apache.org_kamelets.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "camel.apache.org_kamelets.yaml",
@@ -172,7 +172,7 @@ var assets = func() http.FileSystem {
 			modTime:          time.Time{},
 			uncompressedSize: 2686,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\x5d\x6f\xe2\x46\x14\x7d\xf7\xaf\x38\xc2\x2f\xbb\x52\x80\x64\x9f\xb6\xee\x93\x9b\x90\x2e\xea\x16\x10\x66\x1b\xed\x53\x35\x8c\x2f\xf6\x88\xf1\x8c\x3b\x73\x0d\x4b\x7f\x7d\x35\x06\x13\x20\x1f\x6d\xa4\x48\xf5\x53\xf0\xbd\x73\xee\xf9\xb8\xb6\x13\xa3\xff\x7e\x57\x14\xe3\xab\x92\x64\x3c\xe5\x60\x0b\x2e\x09\x69\x2d\x64\x49\xc8\xec\x8a\xb7\xc2\x11\xee\x6d\x63\x72\xc1\xca\x1a\x7c\x48\xb3\xfb\x8f\x68\x4c\x4e\x0e\xd6\x10\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x56\x5d\x6f\xe2\x46\x17\xbe\xf7\xaf\x78\x84\x6f\x76\xa5\x00\xc9\xbe\x37\xfb\xba\x57\x6e\x42\xba\xa8\x5b\x40\x98\x6d\xb4\x57\xd5\x30\x3e\xd8\x23\xc6\x33\xee\xcc\x31\x2c\xfd\xf5\xd5\x18\x4c\x80\x7c\xb4\x91\x22\xd5\x57\xc1\xe7\xcc\x73\x9e\x8f\x63\x3b\x31\xfa\xef\x77\x45\x31\xbe\x2a\x49\xc6\x53\x0e\xb6\xe0\x92\x90\xd6\x42\x96\x84\xcc\xae\x78\x2b\x1c\xe1\xde\x36\x26\x17\xac\xac\xc1\x87\x34\xbb\xff\x88\xc6\xe4\xe4\x60\x [...]
 		},
 		"/manager/operator-service-account.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "operator-service-account.yaml",
@@ -583,9 +583,9 @@ var assets = func() http.FileSystem {
 		"/traits.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "traits.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 51400,
+			uncompressedSize: 51419,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x73\x5b\xb9\x91\xe0\xef\xf3\x57\xa0\xb4\x57\x65\xc9\x45\x52\x9e\xc9\x26\x99\xd3\xdd\x6c\x4e\x63\x7b\x12\xcd\xf8\x43\x67\x6b\x26\x9b\xf2\xb9\x42\xf0\xbd\x26\x09\xf3\x11\x78\x01\xf0\x24\x33\x97\xfb\xdf\xaf\xd0\xdd\xf8\x78\x8f\x94\x44\xd9\xd6\x6c\xb4\xb5\x9b\xaa\x1d\x4b\x7a\x68\x34\x1a\x8d\x46\x7f\xc3\x5b\xa9\xbc\x3b\xf9\x6a\x2c\xb4\x5c\xc3\x89\x90\xf3\xb9\xd2\xca\x6f\xbe\x12\xa2\x6d\xa4\x9f\x1b\xbb\x3e\x11\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\xfd\x73\x5b\xb9\x91\xe0\xef\xf3\x57\xa0\xb4\x57\x65\xc9\x45\x52\x9e\xc9\x26\x99\xd3\xdd\x6c\x4e\x63\x7b\x12\xcd\xf8\x43\x67\x6b\x26\x9b\xf2\xb9\x42\xf0\xbd\x26\x09\xf3\x11\x78\x01\xf0\x24\x33\x97\xfb\xdf\xaf\xd0\xdd\xf8\x78\x8f\x94\x44\xd9\xd6\x6c\xb4\xb5\x9b\xaa\x1d\x4b\x7a\x68\x34\x1a\x8d\x46\x7f\xc3\x5b\xa9\xbc\x3b\xf9\x6a\x2c\xb4\x5c\xc3\x89\x90\xf3\xb9\xd2\xca\x6f\xbe\x12\xa2\x6d\xa4\x9f\x1b\xbb\x3e\x11\x [...]
 		},
 	}
 	fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
diff --git a/pkg/trait/pod_test.go b/pkg/trait/pod_test.go
index 3df6ae2b0..e55e38821 100755
--- a/pkg/trait/pod_test.go
+++ b/pkg/trait/pod_test.go
@@ -22,7 +22,7 @@ import (
 
 	"github.com/stretchr/testify/assert"
 
-	"gopkg.in/yaml.v2"
+	"k8s.io/apimachinery/pkg/util/yaml"
 
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
@@ -87,6 +87,18 @@ func TestChangeEnvVariables(t *testing.T) {
 	assert.Equal(t, containsEnvVariables(templateSpec, "integration", "CAMEL_K_DIGEST"), "new_value")
 }
 
+func TestSupplementalGroup(t *testing.T) {
+	templateString := "{containers: [], securityContext: {supplementalGroups: [666]}}}"
+
+	templateSpec := testPodTemplateSpec(t, templateString)
+
+	// Check if securityContext was added
+	assert.NotNil(t, templateSpec.Spec)
+	assert.NotNil(t, templateSpec.Spec.SecurityContext)
+	assert.NotNil(t, templateSpec.Spec.SecurityContext.SupplementalGroups)
+	assert.Contains(t, templateSpec.Spec.SecurityContext.SupplementalGroups, int64(666))
+}
+
 // nolint: unparam
 func createPodTest(podSpecTemplate string) (*podTrait, *Environment, *appsv1.Deployment) {
 	trait, _ := newPodTrait().(*podTrait)


[camel-k] 02/03: Enable parsing pod template as a modeline.

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 3f6a6d0b2401ff6decf9168483d4594f77b67761
Author: Adriano Machado <unknown>
AuthorDate: Mon Jun 6 10:16:08 2022 -0400

    Enable parsing pod template as a modeline.
---
 go.mod                      |  1 +
 go.sum                      |  1 +
 pkg/cmd/modeline_test.go    | 21 +++++++++++++++++++++
 pkg/util/modeline/parser.go |  5 ++---
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/go.mod b/go.mod
index 751153992..2c15a1092 100644
--- a/go.mod
+++ b/go.mod
@@ -17,6 +17,7 @@ require (
 	github.com/google/uuid v1.3.0
 	github.com/jpillora/backoff v1.0.0
 	github.com/magiconair/properties v1.8.6
+	github.com/mattn/go-shellwords v1.0.3
 	github.com/mitchellh/go-homedir v1.1.0
 	github.com/mitchellh/mapstructure v1.4.3
 	github.com/onsi/gomega v1.19.0
diff --git a/go.sum b/go.sum
index f155714a0..6c7edac32 100644
--- a/go.sum
+++ b/go.sum
@@ -890,6 +890,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
 github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
 github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-shellwords v1.0.3 h1:K/VxK7SZ+cvuPgFSLKi5QPI9Vr/ipOf4C1gN+ntueUk=
 github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
 github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
diff --git a/pkg/cmd/modeline_test.go b/pkg/cmd/modeline_test.go
index 3907dc392..854bd52a9 100644
--- a/pkg/cmd/modeline_test.go
+++ b/pkg/cmd/modeline_test.go
@@ -507,3 +507,24 @@ func TestModelineInspectMultipleDeps(t *testing.T) {
 
 	assert.NoError(t, err)
 }
+
+func TestModelineQuotedPodTemplate(t *testing.T) {
+	err := util.WithTempDir("camel-k-test-", func(dir string) error {
+
+		file := `
+		// camel-k: pod-template='{ "containers": [], "securityContext": { "supplementalGroups": [ 553 ] }, "volumes": [] } }'
+	`
+		fileName := path.Join(dir, "simple.groovy")
+		err := ioutil.WriteFile(fileName, []byte(file), 0o400)
+		assert.NoError(t, err)
+
+		cmd, flags, err := NewKamelWithModelineCommand(context.TODO(), []string{"kamel", "run", fileName})
+		assert.NoError(t, err)
+		assert.NotNil(t, cmd)
+		assert.Equal(t, []string{"run", fileName, "--pod-template={ \"containers\": [], \"securityContext\": { \"supplementalGroups\": [ 553 ] }, \"volumes\": [] } }"}, flags)
+
+		return nil
+	})
+
+	assert.NoError(t, err)
+}
diff --git a/pkg/util/modeline/parser.go b/pkg/util/modeline/parser.go
index 627f496b9..ab1eab580 100644
--- a/pkg/util/modeline/parser.go
+++ b/pkg/util/modeline/parser.go
@@ -24,14 +24,13 @@ import (
 	"strings"
 
 	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+	"github.com/mattn/go-shellwords"
 )
 
 var (
 	commonModelineRegexp = regexp.MustCompile(`^\s*//\s*camel-k\s*:\s*([^\s]+.*)$`)
 	yamlModelineRegexp   = regexp.MustCompile(`^\s*#+\s*camel-k\s*:\s*([^\s]+.*)$`)
 	xmlModelineRegexp    = regexp.MustCompile(`^.*<!--\s*camel-k\s*:\s*([^\s]+[^>]*)-->.*$`)
-
-	delimiter = regexp.MustCompile(`\s+`)
 )
 
 func Parse(name, content string) (res []Option, err error) {
@@ -53,7 +52,7 @@ func getModelineOptions(line string, lang v1.Language) (res []Option) {
 	}
 	strs := reg.FindStringSubmatch(line)
 	if len(strs) == 2 {
-		tokens := delimiter.Split(strs[1], -1)
+		tokens, _ := shellwords.Parse(strs[1])
 		for _, token := range tokens {
 			if len(strings.Trim(token, "\t\n\f\r ")) == 0 {
 				continue


[camel-k] 01/03: Detect wire tap EIP endpoints

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9494c7dc4330c3a293cf83ff3f26109f7efa084d
Author: Adriano Machado <unknown>
AuthorDate: Mon Jun 6 10:13:49 2022 -0400

    Detect wire tap EIP endpoints
---
 examples/wiretap/README.md                    |  3 +++
 examples/wiretap/WireTap.java                 | 36 +++++++++++++++++++++++++++
 pkg/util/source/inspector.go                  |  2 ++
 pkg/util/source/inspector_groovy.go           |  2 ++
 pkg/util/source/inspector_groovy_test.go      |  9 +++++++
 pkg/util/source/inspector_java_script.go      |  2 ++
 pkg/util/source/inspector_java_script_test.go |  9 +++++++
 pkg/util/source/inspector_java_source.go      |  1 +
 pkg/util/source/inspector_java_source_test.go |  9 +++++++
 pkg/util/source/inspector_kotlin.go           |  1 +
 pkg/util/source/inspector_kotlin_test.go      |  9 +++++++
 pkg/util/source/inspector_xml.go              |  2 +-
 pkg/util/source/inspector_xml_test.go         | 13 ++++++++++
 pkg/util/source/inspector_yaml.go             |  2 +-
 pkg/util/source/inspector_yaml_test.go        | 36 +++++++++++++++++++++++++++
 15 files changed, 134 insertions(+), 2 deletions(-)

diff --git a/examples/wiretap/README.md b/examples/wiretap/README.md
new file mode 100644
index 000000000..daed2a363
--- /dev/null
+++ b/examples/wiretap/README.md
@@ -0,0 +1,3 @@
+# Camel K WireTap example
+
+Find useful examples about how use a "WireTap" EIP in a Camel K integration.
diff --git a/examples/wiretap/WireTap.java b/examples/wiretap/WireTap.java
new file mode 100644
index 000000000..556b524d5
--- /dev/null
+++ b/examples/wiretap/WireTap.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// To run this integrations use:
+//
+// kamel run WireTap.java --dev
+//
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class WireTap extends RouteBuilder {
+
+  @Override
+  public void configure() throws Exception {
+	  from("timer:tick")
+	    .wireTap("direct:tap")
+        .log("Hello from the timer!");
+
+      from("direct:tap")
+        .log("Hello from the tap!");
+  }
+}
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 651af7344..be2b86ddc 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -40,9 +40,11 @@ var (
 	singleQuotedTo          = regexp.MustCompile(`\.to\s*\(\s*'([a-zA-Z0-9-]+:[^']+)'`)
 	singleQuotedToD         = regexp.MustCompile(`\.toD\s*\(\s*'([a-zA-Z0-9-]+:[^']+)'`)
 	singleQuotedToF         = regexp.MustCompile(`\.toF\s*\(\s*'([a-zA-Z0-9-]+:[^']+)'`)
+	singleQuotedWireTap     = regexp.MustCompile(`\.wireTap\s*\(\s*'([a-zA-Z0-9-]+:[^']+)'`)
 	doubleQuotedTo          = regexp.MustCompile(`\.to\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
 	doubleQuotedToD         = regexp.MustCompile(`\.toD\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
 	doubleQuotedToF         = regexp.MustCompile(`\.toF\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
+	doubleQuotedWireTap     = regexp.MustCompile(`\.wireTap\s*\(\s*"([a-zA-Z0-9-]+:[^"]+)"`)
 	languageRegexp          = regexp.MustCompile(`language\s*\(\s*["|']([a-zA-Z0-9-]+[^"|']+)["|']\s*,.*\)`)
 	camelTypeRegexp         = regexp.MustCompile(`.*(org.apache.camel.*Component|DataFormat|Language)`)
 	jsonLibraryRegexp       = regexp.MustCompile(`.*JsonLibrary\.Jackson.*`)
diff --git a/pkg/util/source/inspector_groovy.go b/pkg/util/source/inspector_groovy.go
index 318107862..686814084 100644
--- a/pkg/util/source/inspector_groovy.go
+++ b/pkg/util/source/inspector_groovy.go
@@ -42,6 +42,8 @@ func (i GroovyInspector) Extract(source v1.SourceSpec, meta *Metadata) error {
 		doubleQuotedToD,
 		singleQuotedToF,
 		doubleQuotedToF,
+		singleQuotedWireTap,
+		doubleQuotedWireTap,
 	)
 
 	meta.FromURIs = append(meta.FromURIs, from...)
diff --git a/pkg/util/source/inspector_groovy_test.go b/pkg/util/source/inspector_groovy_test.go
index 7f091f3b8..d0d2a5e80 100644
--- a/pkg/util/source/inspector_groovy_test.go
+++ b/pkg/util/source/inspector_groovy_test.go
@@ -48,6 +48,11 @@ from("direct:start")
     .to('kamelet:foo/bar?baz=test')
 `
 
+const GroovyWireTapEipSingleQuote = `
+from("direct:start")
+    .wireTap('kamelet:foo/bar?baz=test')
+`
+
 func TestGroovyKamelet(t *testing.T) {
 	tc := []struct {
 		source   string
@@ -69,6 +74,10 @@ func TestGroovyKamelet(t *testing.T) {
 			source:   GroovyKameletEndpointSingleQuote,
 			kamelets: []string{"foo/bar"},
 		},
+		{
+			source:   GroovyWireTapEipSingleQuote,
+			kamelets: []string{"foo/bar"},
+		},
 	}
 
 	for i := range tc {
diff --git a/pkg/util/source/inspector_java_script.go b/pkg/util/source/inspector_java_script.go
index d8679e0c9..ebcbe37bb 100644
--- a/pkg/util/source/inspector_java_script.go
+++ b/pkg/util/source/inspector_java_script.go
@@ -42,6 +42,8 @@ func (i JavaScriptInspector) Extract(source v1.SourceSpec, meta *Metadata) error
 		doubleQuotedToD,
 		singleQuotedToF,
 		doubleQuotedToF,
+		singleQuotedWireTap,
+		doubleQuotedWireTap,
 	)
 
 	meta.FromURIs = append(meta.FromURIs, from...)
diff --git a/pkg/util/source/inspector_java_script_test.go b/pkg/util/source/inspector_java_script_test.go
index f9e1634a6..3ed09d928 100644
--- a/pkg/util/source/inspector_java_script_test.go
+++ b/pkg/util/source/inspector_java_script_test.go
@@ -37,6 +37,11 @@ from("direct:start")
     .to("kamelet:foo/bar?baz=test")
 `
 
+const JavaScriptWireTapEipSingleQuote = `
+from("direct:start")
+    .wireTap('kamelet:foo/bar?baz=test')
+`
+
 func TestJavaScriptKamelet(t *testing.T) {
 	tc := []struct {
 		source   string
@@ -50,6 +55,10 @@ func TestJavaScriptKamelet(t *testing.T) {
 			source:   JavaScriptKameletEndpoint,
 			kamelets: []string{"foo/bar"},
 		},
+		{
+			source:   JavaScriptWireTapEipSingleQuote,
+			kamelets: []string{"foo/bar"},
+		},
 	}
 
 	for i := range tc {
diff --git a/pkg/util/source/inspector_java_source.go b/pkg/util/source/inspector_java_source.go
index 80981e74b..00a9f391f 100644
--- a/pkg/util/source/inspector_java_source.go
+++ b/pkg/util/source/inspector_java_source.go
@@ -37,6 +37,7 @@ func (i JavaSourceInspector) Extract(source v1.SourceSpec, meta *Metadata) error
 		doubleQuotedTo,
 		doubleQuotedToD,
 		doubleQuotedToF,
+		doubleQuotedWireTap,
 	)
 
 	meta.FromURIs = append(meta.FromURIs, from...)
diff --git a/pkg/util/source/inspector_java_source_test.go b/pkg/util/source/inspector_java_source_test.go
index 353643130..af1a8e3af 100644
--- a/pkg/util/source/inspector_java_source_test.go
+++ b/pkg/util/source/inspector_java_source_test.go
@@ -37,6 +37,11 @@ from("direct:start")
     .to("kamelet:foo/bar?baz=test")
 `
 
+const JavaSourceWireTapEip = `
+from("direct:start")
+    .wireTap("kamelet:foo/bar?baz=test")
+`
+
 func TestJavaSourceKamelet(t *testing.T) {
 	tc := []struct {
 		source   string
@@ -50,6 +55,10 @@ func TestJavaSourceKamelet(t *testing.T) {
 			source:   JavaSourceKameletEndpoint,
 			kamelets: []string{"foo/bar"},
 		},
+		{
+			source:   JavaSourceWireTapEip,
+			kamelets: []string{"foo/bar"},
+		},
 	}
 
 	for i := range tc {
diff --git a/pkg/util/source/inspector_kotlin.go b/pkg/util/source/inspector_kotlin.go
index b2485c29b..753d0dbbf 100644
--- a/pkg/util/source/inspector_kotlin.go
+++ b/pkg/util/source/inspector_kotlin.go
@@ -37,6 +37,7 @@ func (i KotlinInspector) Extract(source v1.SourceSpec, meta *Metadata) error {
 		doubleQuotedTo,
 		doubleQuotedToD,
 		doubleQuotedToF,
+		doubleQuotedWireTap,
 	)
 
 	meta.FromURIs = append(meta.FromURIs, from...)
diff --git a/pkg/util/source/inspector_kotlin_test.go b/pkg/util/source/inspector_kotlin_test.go
index d94ee7fd9..1b08fe2b3 100644
--- a/pkg/util/source/inspector_kotlin_test.go
+++ b/pkg/util/source/inspector_kotlin_test.go
@@ -37,6 +37,11 @@ from("direct:start")
     .to("kamelet:foo/bar?baz=test")
 `
 
+const KotlinWireTapEip = `
+from("direct:start")
+    .wireTap("kamelet:foo/bar?baz=test")
+`
+
 func TestKotlinKamelet(t *testing.T) {
 	tc := []struct {
 		source   string
@@ -50,6 +55,10 @@ func TestKotlinKamelet(t *testing.T) {
 			source:   KotlinKameletEndpoint,
 			kamelets: []string{"foo/bar"},
 		},
+		{
+			source:   KotlinWireTapEip,
+			kamelets: []string{"foo/bar"},
+		},
 	}
 
 	for i := range tc {
diff --git a/pkg/util/source/inspector_xml.go b/pkg/util/source/inspector_xml.go
index 18c48277c..51baaee24 100644
--- a/pkg/util/source/inspector_xml.go
+++ b/pkg/util/source/inspector_xml.go
@@ -62,7 +62,7 @@ func (i XMLInspector) Extract(source v1.SourceSpec, meta *Metadata) error {
 						meta.FromURIs = append(meta.FromURIs, a.Value)
 					}
 				}
-			case "to", "toD", "toF":
+			case "to", "toD", "toF", "wireTap":
 				for _, a := range se.Attr {
 					if a.Name.Local == "uri" {
 						meta.ToURIs = append(meta.ToURIs, a.Value)
diff --git a/pkg/util/source/inspector_xml_test.go b/pkg/util/source/inspector_xml_test.go
index 52445e820..8552a84b7 100644
--- a/pkg/util/source/inspector_xml_test.go
+++ b/pkg/util/source/inspector_xml_test.go
@@ -46,6 +46,15 @@ const XMLKameletEndpoint = `
 </camelContext>
 `
 
+const XMLWireTapEndpoint = `
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+  <route>
+    <from uri="direct:start"/>
+    <wireTap uri="kamelet:foo/bar?baz=test"/>
+  </route>
+</camelContext>
+`
+
 func TestXMLKamelet(t *testing.T) {
 	tc := []struct {
 		source   string
@@ -59,6 +68,10 @@ func TestXMLKamelet(t *testing.T) {
 			source:   XMLKameletEndpoint,
 			kamelets: []string{"foo/bar"},
 		},
+		{
+			source:   XMLWireTapEndpoint,
+			kamelets: []string{"foo/bar"},
+		},
 	}
 
 	for i := range tc {
diff --git a/pkg/util/source/inspector_yaml.go b/pkg/util/source/inspector_yaml.go
index 379bd100b..99ed8b876 100644
--- a/pkg/util/source/inspector_yaml.go
+++ b/pkg/util/source/inspector_yaml.go
@@ -161,7 +161,7 @@ func (i YAMLInspector) parseStep(key string, content interface{}, meta *Metadata
 		switch key {
 		case "from":
 			meta.FromURIs = append(meta.FromURIs, maybeURI)
-		case "to", "to-d", "toD":
+		case "to", "to-d", "toD", "wire-tap", "wireTap":
 			meta.ToURIs = append(meta.ToURIs, maybeURI)
 		}
 	}
diff --git a/pkg/util/source/inspector_yaml_test.go b/pkg/util/source/inspector_yaml_test.go
index 88d77d5ba..1a85b1fd5 100644
--- a/pkg/util/source/inspector_yaml_test.go
+++ b/pkg/util/source/inspector_yaml_test.go
@@ -83,6 +83,26 @@ const YAMLInDepthChannel = `
                 uri: knative:endpoint/service
 `
 
+const YAMLWireTapKnativeEIP = `
+- from:
+    uri: knative:channel/mychannel
+    parameters:
+      period: "1000"
+    steps:
+      - wireTap:
+          uri: knative:channel/mychannel
+`
+
+const YAMLWireTapJmsEIP = `
+- from:
+    uri: knative:channel/mychannel
+    parameters:
+      period: "1000"
+    steps:
+      - wireTap:
+          uri: jms:queue:foo
+`
+
 func TestYAMLDependencies(t *testing.T) {
 	tests := []struct {
 		name                string
@@ -125,6 +145,22 @@ func TestYAMLDependencies(t *testing.T) {
 				`mvn:org.apache.camel.k:camel-k-knative-consumer`,
 			},
 		},
+		{
+			name:   "wire-tap-knative",
+			source: YAMLWireTapKnativeEIP,
+			dependencies: []string{
+				`mvn:org.apache.camel.k:camel-k-knative-producer`,
+				`mvn:org.apache.camel.k:camel-k-knative-consumer`,
+			},
+		},
+		{
+			name:   "wire-tap-jms",
+			source: YAMLWireTapJmsEIP,
+			dependencies: []string{
+				`mvn:org.apache.camel.k:camel-k-knative-consumer`,
+				`camel:jms`,
+			},
+		},
 	}
 	for i := range tests {
 		test := tests[i]