mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
* first commit for go 1.26 fix golangci-lint fix Makefile golang-ci-lint remove -goroutineleak flag fix golangci-lint new introduced error ignore new golangci-lint warnings disable newexpr which cause false warning fix cursor suggestion * fix comment * Add disable newexpr * Fix ci proxy fail * go mod tidy under ray-operator --------- Signed-off-by: Yuan Hao Ku <[email protected]>
1.9 KiB
1.9 KiB
Development
This section walks through how to build and test the plugin.
Requirements
| software | version | link |
|---|---|---|
| kubectl | >= 1.23 | download |
| go | v1.26 | download-go |
IDE Setup (VS Code)
- Install the VS Code Go extension
- Import the KubeRay workspace configuration by using the file
kuberay.code-workspacein the root of the KubeRay git repo: "File" -> "Open Workspace from File" -> "kuberay.code-workspace".
Setting up workspace configuration is required because KubeRay contains multiple Go modules. See the VS Code Go documentation for details.
Run unit tests
Run unit tests with the following command.
cd kubectl-plugin
go test ./pkg/... -race -parallel 4
Manual Tests
To manually test the plugin, you can build and install the plugin locally and run the plugin commands against a Kubernetes cluster where you have deployed the KubeRay Operator.
- Build the plugin with
go build cmd/kubectl-ray.go. - If you manage your plugins with Krew, move the executable file to the Krew plugin directory with
mv kubectl-ray ~/.krew/bin. Otherwise, move the executable to anywhere in yourPATH. - Run plugin commands against a Kubernetes cluster where you have deployed the KubeRay Operator.
Select the cluster by first running
kubectl config use-context <context>or per-command with thekubectl ray --contextflag.