Skip to content

Commit 5ffc42e

Browse files
authored
[chore][kubectl-plugin] use consistent capitalization (ray-project#2950)
in comments and console messages. capitalize "Ray" when used as a proper noun. Similar to ray-project#2922. Signed-off-by: David Xia <david@davidxia.com>
1 parent d70270a commit 5ffc42e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

kubectl-plugin/pkg/cmd/job/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
func NewJobCommand(streams genericclioptions.IOStreams) *cobra.Command {
99
cmd := &cobra.Command{
1010
Use: "job",
11-
Short: "submit ray job",
11+
Short: "submit Ray job",
1212
SilenceUsage: true,
1313
Run: func(cmd *cobra.Command, args []string) {
1414
cmd.HelpFunc()(cmd, args)

kubectl-plugin/pkg/cmd/log/log.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func NewClusterLogCommand(streams genericclioptions.IOStreams) *cobra.Command {
8383

8484
cmd := &cobra.Command{
8585
Use: "log (RAYCLUSTER | TYPE/NAME) [--out-dir DIR_PATH] [--node-type all|head|worker]",
86-
Short: "Get ray cluster log",
86+
Short: "Get Ray cluster log",
8787
Long: logLong,
8888
Example: logExample,
8989
Aliases: []string{"logs"},
@@ -195,7 +195,7 @@ func (options *ClusterLogOptions) Run(ctx context.Context, factory cmdutil.Facto
195195
return fmt.Errorf("failed to retrieve kubernetes client set: %w", err)
196196
}
197197

198-
// Retrieve raycluster name for the non raycluster type node
198+
// Retrieve RayCluster name for the non RayCluster type node
199199
var clusterName string
200200
switch options.ResourceType {
201201
case util.RayCluster:
@@ -245,13 +245,13 @@ func (options *ClusterLogOptions) Run(ctx context.Context, factory cmdutil.Facto
245245
if deleteOutputDir {
246246
os.Remove(options.outputDir)
247247
}
248-
return fmt.Errorf("No ray nodes found for resource %s", clusterName)
248+
return fmt.Errorf("No Ray nodes found for resource %s", clusterName)
249249
}
250250

251-
// Get a list of logs of the ray nodes.
251+
// Get a list of logs of the Ray nodes.
252252
var logList []*bytes.Buffer
253253
for _, rayNode := range rayNodes.Items {
254-
// Since the first container is always the ray container, we will retrieve the first container logs
254+
// Since the first container is always the Ray container, we will retrieve the first container logs
255255
containerName := rayNode.Spec.Containers[0].Name
256256
request := clientSet.KubernetesClient().CoreV1().Pods(rayNode.Namespace).GetLogs(rayNode.Name, &corev1.PodLogOptions{Container: containerName})
257257

@@ -271,7 +271,7 @@ func (options *ClusterLogOptions) Run(ctx context.Context, factory cmdutil.Facto
271271
logList = append(logList, buf)
272272
}
273273

274-
// Pod file name format is name of the ray node
274+
// Pod file name format is name of the Ray node
275275
for ind, logList := range logList {
276276
curFilePath := filepath.Join(options.outputDir, rayNodes.Items[ind].Name, "stdout.log")
277277
dirPath := filepath.Join(options.outputDir, rayNodes.Items[ind].Name)
@@ -336,7 +336,7 @@ func (dre *DefaultRemoteExecutor) CreateExecutor(restConfig *rest.Config, url *u
336336
return remotecommand.NewSPDYExecutor(restConfig, "POST", url)
337337
}
338338

339-
// downloadRayLogFiles will use to the executor and retrieve the logs file from the inputted ray head
339+
// downloadRayLogFiles will use to the executor and retrieve the logs file from the inputted Ray head
340340
func (options *ClusterLogOptions) downloadRayLogFiles(ctx context.Context, exec remotecommand.Executor, rayNode corev1.Pod) error {
341341
outreader, outStream := io.Pipe()
342342
go func() {
@@ -356,7 +356,7 @@ func (options *ClusterLogOptions) downloadRayLogFiles(ctx context.Context, exec
356356
tarReader := tar.NewReader(outreader)
357357
header, err := tarReader.Next()
358358
if err != nil && !errors.Is(err, io.EOF) {
359-
return fmt.Errorf("error will extracting head tar file for ray head %s: %w", rayNode.Name, err)
359+
return fmt.Errorf("error will extracting head tar file for Ray head %s: %w", rayNode.Name, err)
360360
}
361361

362362
fmt.Fprintf(options.ioStreams.Out, "Downloading log for Ray Node %s\n", rayNode.Name)

kubectl-plugin/test/e2e/kubectl_ray_log_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ var _ = Describe("Calling ray plugin `log` command on Ray Cluster", func() {
217217
output, err := cmd.CombinedOutput()
218218

219219
Expect(err).To(HaveOccurred())
220-
Expect(strings.TrimSpace(string(output))).To(ContainSubstring("No ray nodes found for resource fakecluster"))
220+
Expect(strings.TrimSpace(string(output))).To(ContainSubstring("No Ray nodes found for resource fakecluster"))
221221
})
222222

223223
It("should not succeed with non-existent directory set", func() {

0 commit comments

Comments
 (0)