Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lauri Apple <2453640+LappleApple@users.noreply.github.com>
  • Loading branch information
yitsushi and LappleApple authored Jul 20, 2023
1 parent 59eaa7f commit 50cc6b0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/branch_based_planner/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Getting Started With Branch Planner

If the Branch Planner is enabled through Helm values, the Branch Planner will
If the Branch Planner is enabled through Helm values, it will
watch all configured Terraform resources, check their referenced Source, and
polls for Pull Requests using GitHub's API with the provided token.
poll for Pull Requests using GitHub's API plus the provided token.

When an open Pull Request is detected, the Branch Planner creates a new or
updates an existing Terraform object with Plan Only mode from the original
Terraform object.

When a Plan Output is available, the Branch Planner creates a new comment under
the Pull Request with the content of the Plan Output.
When a Plan Output becomes available, the Branch Planner creates a new comment under
the Pull Request with the content of the Plan Output included.

## Pre-requirements
## Prerequisites

1. Flux is installed on the cluster.
2. GitHub [API token](./least-required-permissions.md).
3. Knowledge about GitOps Terraform Controller.
2. A GitHub [API token](./least-required-permissions.md).
3. Knowledge about GitOps Terraform Controller [(see docs)](https://weaveworks.github.io/tf-controller/).

## Configure Branch Planner

Branch Planner uses a ConfigMap as configuration. By default it's looking for a
`barnch-planner` ConfigMap in the same namespace as the `tf-controller` is
`branch-planner` ConfigMap in the same namespace as where the `tf-controller` is
installed.

The ConfigMap has two fields:

1. `secretName` that contains the API token to access GitHub.
2. `resources` that defined a list of resources to watch.
1. `secretName`, which contains the API token to access GitHub.
2. `resources`, which defines a list of resources to watch.

```yaml
---
Expand All @@ -43,7 +43,7 @@ data:
### Secret
Branch Planner uses the referenced Secret with a `token` field to acquire the
Branch Planner uses the referenced Secret with a `token` field that acquires the
API token to fetch Pull Request information.

```bash
Expand All @@ -54,11 +54,11 @@ kubectl create secret generic branch-planner-token \

### Resources

If the `resources` list is empty, nothing will be watched. Resource definition
If the `resources` list is empty, nothing will be watched. The resource definition
can be exact or namespace-wide.

With the following configuration file, all Terraform objects will be watched in
the `terraform` namespace, and `exact-terraform-object` Terraform object in
With the following configuration file, the Branch Planner will watch all Terraform objects in
the `terraform` namespace, and the `exact-terraform-object` Terraform object in
`default` namespace.

```yaml
Expand Down

0 comments on commit 50cc6b0

Please sign in to comment.