Skip to content

Commit

Permalink
removed examples from Makefile and updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
humoflife committed Mar 5, 2024
1 parent f129080 commit 258031c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 13 deletions.
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,6 @@ CROSSPLANE_NAMESPACE = upbound-system
-include build/makelib/local.xpkg.mk
-include build/makelib/controlplane.mk

V="v1alpha1"
EG_DIR="./examples/"
EG_DD_DIR="${EG_DIR}/datadog/${V}"
EG_LOGS_DIR="${EG_DIR}/logs/${V}"
EG_METRIC_DIR="${EG_DIR}/metric/${V}"
EG_SDS_DIR="${EG_DIR}/sensitivedatascanner/${V}"
EG_SYN_DIR="${EG_DIR}/synthetics/${V}"
# UPTEST_EXAMPLE_LIST="${EG_DD_DIR}/dashboardjson.yaml,${EG_DD_DIR}/monitorconfigpolicy.yaml,${EG_DD_DIR}/monitorjson.yaml,${EG_DD_DIR}/monitor.yaml,${EG_DD_DIR}/powerpack.yaml,${EG_DD_DIR}/role.yaml,${EG_DD_DIR}/team.yaml,${EG_DD_DIR}/user.yaml,${EG_DD_DIR}/webhook.yaml,${EG_LOGS_DIR}/metric.yaml,${EG_METRIC_DIR}/metadata.yaml,${EG_SDS_DIR}/group.yaml,${EG_SYN_DIR}/concurrencycap.yaml,${EG_SYN_DIR}/globalvariable.yaml,${EG_SYN_DIR}/privatelocation.yaml"
UPTEST_EXAMPLE_LIST="${EG_DD_DIR}/dashboardjson.yaml"

# This target requires the following environment variables to be set:
# - UPTEST_EXAMPLE_LIST, a comma-separated list of examples to test
# To ensure the proper functioning of the end-to-end test resource pre-deletion hook, it is crucial to arrange your resources appropriately.
Expand Down
58 changes: 55 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,59 @@ is built using [Upjet](https://github.com/crossplane/upjet) code
generation tools and exposes XRM-conformant managed resources for the
Datadog API.

## Prerequisites

This provider interacts with a
[Datadog account](https://www.datadoghq.com/). It authenticates
to the account using a Datadog API Key, an Application key, and
a Datadog account endpoint URL.
The keys can be generated inside the account
and be stored in a Kubernetes secret on the Crossplane
management cluster. The format of the secret is as follows:
```
{
"api_key": "INSERT_API_KEY",
"app_key": "INSERT_APP_KEY",
"api_url": "https://api.datadoghq.com/"
}
```
Note that your preferred endpoint may differ.
The Kubernertes secret can be referenced by
the ProviderConfig, so that the provider-datadog can connect
to the desired Datadog account. A ProviderConfig may look
as follows:
```
apiVersion: datadog.upbound.io/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
name: datadog-creds
namespace: upbound-system
key: credentials
```

To run local tests, create a datadog-secret file per above.
Then create an `UPTEST_CLOUD_CREDENTIALS` environment variable
as follows
```
export UPTEST_CLOUD_CREDENTIALS=$(cat <PATH-TO-DATADOG-SECRET-FILE> )
```
Once complete, specify the tests that you would like to run
in the `UPTEST_EXAMPLE_LIST` environment variable. An example
is as follows:
```
export UPTEST_EXAMPLE_LIST="./examples/datadog/dashboardjson.yaml"
```
Note that you may specify multiple comma separated tests.
Now run `UPTEST_EXAMPLE_LIST="./examples/datadog/v1alpha1/dashboardjson.yaml" make e2e`. This will create a local kind cluster,
install Crossplane and the provider-datadog from a local build
and run Uptests managed resources apply, update, import, delete
tests.

## Getting Started

Install the provider by using the following command after changing the image tag
Expand All @@ -25,15 +78,14 @@ spec:
EOF
```

Notice that in this example Provider resource is referencing ControllerConfig with debug enabled.

You can see the API reference [here](https://doc.crds.dev/github.com/upbound/provider-datadog).

## Developing

Run code-generation pipeline:

```console
go run cmd/generator/main.go "$PWD"
make clean; make gen-clean; make generate
```

Run against a Kubernetes cluster:
Expand Down

0 comments on commit 258031c

Please sign in to comment.