This is a cache of https://docs.openshift.com/serverless/1.29/eventing/triggers/update-triggers-cli.html. It is a snapshot of the page at 2024-11-25T17:10:51.281+0000.
Updating triggers from the command line - Triggers | Eventing | Red Hat OpenShift Serverless 1.29
×

Using the Knative (kn) cli to update triggers provides a streamlined and intuitive user interface.

Updating a trigger by using the Knative cli

You can use the kn trigger update command with certain flags to update attributes for a trigger.

Prerequisites
  • The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.

  • You have installed the Knative (kn) cli.

  • You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in OpenShift Container Platform.

Procedure
  • Update a trigger:

    $ kn trigger update <trigger_name> --filter <key=value> --sink <sink_name> [flags]
    • You can update a trigger to filter exact event attributes that match incoming events. For example, using the type attribute:

      $ kn trigger update <trigger_name> --filter type=knative.dev.event
    • You can remove a filter attribute from a trigger. For example, you can remove the filter attribute with key type:

      $ kn trigger update <trigger_name> --filter type-
    • You can use the --sink parameter to change the event sink of a trigger:

      $ kn trigger update <trigger_name> --sink ksvc:my-event-sink