In gen1 Cloud Function with PubSub trigger, the subscription can easily be edited using the CLI, because the subscription name has a deterministic name of the pattern “gcf-<FUNCTION_NAME>–<TOPIC_NAME>”. This is very useful for subscription settings such as retry delay, ack deadine, and message retention duration.
However, in gen2, the subscription name appears to be random, e.g., “eventarc–<FUNCTION_NAME_LOWERCASE>-<RANDOM_INT>-sub-400”. How then do we programatically update the subscription using the CLI after deploying the function?