Files
Yuan Hao KuandGitHub d7855fbec8 Upgrade to golang v1.26 from v1.25 (#4597)
* 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]>
2026-05-01 13:06:17 -07:00

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)

  1. Install the VS Code Go extension
  2. Import the KubeRay workspace configuration by using the file kuberay.code-workspace in 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.

  1. Build the plugin with go build cmd/kubectl-ray.go.
  2. 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 your PATH.
  3. 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 the kubectl ray --context flag.