Skip to content

Commit

Permalink
Docs | minor watch-pattern example fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dag-andersen committed Oct 30, 2024
1 parent a822e63 commit 7d1bb8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/application-selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Here are _4_ ways to limit which applications are rendered:

You can configure the tool to render only the applications affected by changes in a pull request. This optimizes the rendering process by focusing on the applications directly impacted by the modified files.

To achieve this, you need to add the annotation: `argocd-diff-preview/watch-pattern` to all your Applications/ApplicationSets, and provide the tool with a list of changed files. If no list is provided, the annotation will be ignored.
To achieve this, you need to add the annotation: `argocd-diff-preview/watch-pattern` to all your Applications/ApplicationSets, and provide the tool with a list of changed files. If no list is provided, the annotation will be ignored. The `watch-pattern` annotation takes a comma-separated list of file paths or regex patterns. The tool will render the application if any of the patterns match the changed files.

*Example:*

By adding the annotation `argocd-diff-preview/watch-pattern: "examples/.*"` to the Application manifest, the `my-app` application will only be rendered if a file in the `examples/` folder is modified in the PR. However, the `my-app` application will also be rendered if its own `Application` manifest is changed, so there's no need to include the application's file path in the watch-pattern annotation.
By adding the annotation `argocd-diff-preview/watch-pattern: "examples/helm/charts/myApp/.*, examples/helm/values/filtered.yaml"` to the Application manifest, the `my-app` application will only be rendered if the `filtered.yaml` file or a file in the `examples/helm/charts/myApp/` folder is modified in the PR. However, the `my-app` application will also be rendered if its own `Application` manifest is changed, so there's no need to include the application's file path in the watch-pattern annotation.

```yaml title="Application" hl_lines="7"
apiVersion: argoproj.io/v1alpha1
Expand Down

0 comments on commit 7d1bb8c

Please sign in to comment.