IDE Integration
We don’t require or recommend any specific IDE to develop for K8up. Here’s just some documentation to help you setting-up K8up in some specific IDEs that are in use by the K8up developers.
JetBrains GoLand
You can basically just open the root directory in GoLand and you’ll be mostly ready. Just in order to run the integration tests you will need to do some extra configuration:
-
Before you can run an integration test from GoLand, you need to run
make integration-test
. -
You need to tell GoLand to consider the integration build tag when building:
-
Go to Preferences → Go → Build Tags & Vendoring
-
Put
integration
into Custom tags
-
-
Now try to run a specific integration test.
You can use all the usual shortcuts to quickly run a test (for example Ctrl+Shift+D to debug a specific test method). If it doesn’t work, check the following:
-
Check that the Custom tags field in Preferences → Go → Build Tags & Vendoring contains to term
integration
. -
Make sure the Working directory of your test’s Run Configuration points to the directory where your test lies, for example
/home/your_user/projects/k8up/controllers
. -
Try to tick Use all custom build tags checkbox in your test’s Run Configuration.
Remember that you need to re-run |
If you’re in doubt about your configuration, check whether |
Visual Studio Code
Example VSCode run configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/operator/main.go",
"env": {
"BACKUP_IMAGE": "ghcr.io/k8up-io/k8up:latest",
"BACKUP_GLOBALS3ENDPOINT": "http://somewhere.example.org",
"BACKUP_GLOBALS3BUCKET": "somebucket",
"BACKUP_GLOBALSECRETACCESSKEY": "replacewithaccesskey",
"BACKUP_GLOBALACCESSKEYID": "replacewithkeyid",
"BACKUP_GLOBALREPOPASSWORD": "somepassword"
},
"args": []
}
]
}