Debugging
The following are prescribed options that you may choose to follow, for assisting you with your developments.
- Open this code at the root of the lab code directory with Visual Studio Code.
- Install necessary VS Code plugins/extensions for Go: https://github.com/golang/vscode-go#getting-started
- Follow directions for debugging: https://github.com/golang/vscode-go/blob/master/docs/debugging.md#set-up
To debug Unit tests:
- Set break points
- Select the file
suite_test.go
as your “Run and Debug” starting point
To debug an operator instance:
- Set break points
- Select the file
main.go
as your “Run and Debug” starting point - Create an instance of an operator:
k apply -f config/samples/operators-over-ez_v1alpha1_opsovereasy.yaml
For this setup, you will not need a launch.json
file.
- Install Go plugins
- Create new project project and specify:
- Go
- Location: Root of the lab code directory
- GOROOT: Specify or install one if necessary (i.e. Go 1.14.6)
- Check
Index entire GOPATH
- Click
Create
- Select
Create from existing sources
To debug Unit tests:
- Set break points
- Right-click the file
suite_test.go
and select:Debug 'suite_test.go'
To debug an operator instance:
- Set break points
- Right-click the file
main.go
and select:Debug 'main.go'
- Create an instance of an operator:
k apply -f config/samples/operators-over-ez_v1alpha1_opsovereasy.yaml