Skip to content

Commit

Permalink
feat: Add note for project dependency gotcha in mockgcp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvigil authored Dec 4, 2024
1 parent cfb1539 commit 84c98ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/develop-resources/deep-dives/1-add-mockgcp-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Create a directory for your resource [pkg/test/resourcefixture/testdata/basic](p
Just to add the `create.yaml`, `update.yaml` and `dependencies.yaml` (if applicable) to each bottommost directory.
These three files are all Kubernetes config files, except that `create.yaml` and `update.yaml` only holds the your Config Connector CR object, and the `dependencies.yaml` holds all the dependent objects.

Note: Do not add your GCP Project as a dependency in `dependencies.yaml` (even with the `cnrm.cloud.google.com/deletion-policy: abandon` annotation). Adding your project as a dependency will cause Config Connector to add the label `cnrm-test: true` to your project during test runs, which likely not desirable. Instead, you can refer to your development project in the `create.yaml` and `update.yaml` resources via an external project reference, with the `${projectId}` template variable. For example:
```
projectRef:
external: ${projectId}
```

## 1.2 Write the MockGCP server

Follow [this guide](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/master/mockgcp/README.md) to write a mock gcp server.
Expand Down

0 comments on commit 84c98ad

Please sign in to comment.