Run the following command to build the provider
make install
First, build and install the provider.
make install
Get your offline token from https://cloud.redhat.com/openshift/token.
Then, run the following command to initialize the workspace and apply the sample configuration.
export OFFLINE_TOKEN=<offline token>
terraform init && terraform apply
Run the launch configuration called Debug in VsCode, this will output a value for an environment variable
called TF_REATTACH_PROVIDERS
in the Debug Console window, copy this output.
When running a terraform command set the environment variable TF_REATTACH_PROVIDERS
to the value given
either through export or setting it inline before the command.
TF_REATTACH_PROVIDERS='{"provider": ... }' terraform apply
export TF_REATTACH_PROVIDERS='{"provider": ... }'
terraform apply
Create a configuration that matched the following, add the path to the root of the project for Directory
and Working Directory
.
And add the --debug
flag to the program arguments.
Then run the project in debug mode this will output a value for an environment variable called TF_REATTACH_PROVIDERS
in the Debug Console window, copy this output.
When running a terraform command set the environment variable TF_REATTACH_PROVIDERS
to the value given
either through export or setting it inline before the command.
TF_REATTACH_PROVIDERS='{"provider": ... }' terraform apply
export TF_REATTACH_PROVIDERS='{"provider": ... }'
terraform apply
All text strings are placed in ./rhoas/localize/locales/en
directory containing .toml
files.
These files are used in:
- Provider itself - all printed messages/strings
- generation of the documentation
This directory contains number of toml
files that are used for:
- Data source and resource definitions for later use in generated documentation
- Provider output and error messages that aren't included in the generated documentation.
Each time we change any strings in data source and resource definitions we should regenerate markdown documentation files and push them with the PR.
RHOAS SDK provides mock for all supported APIs. To use mock you need to have NPM installed on your system and have free port 8000 To work and test provider locally please follow the mock readme.
Define the LOCAL_DEV enviroment variable to use the locally running mock server.
LOCAL_DEV=http://localhost:8000 terraform apply
To log in to the mock API, run rhoas login
against the local server with your authentication token:
rhoas login --api-gateway=http://localhost:8000
- To run the unit tests, run
make test
in the root of the project - To run the acceptance tests, run
make testacc
in the root of the project.
There are two options for linting in the provider the first is the standard go linter which will lint all go code. This is also run as a github action when making a pull request so if you need to fix the linting on your pr follow the steps below.
- Install golangci-lint
- Run
make lint
We also lint all internationalization files and uses in the provider, this is done by the commands below and this is also run as github action.
- Run
make lint-lang