Skip to content

Commit 522718e

Browse files
authored
[kubectl-plugin] silence warnings when creating worker groups (#2792)
Signed-off-by: Andrew Sy Kim <[email protected]>
1 parent 8dd2496 commit 522718e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kubectl-plugin/pkg/cmd/create/create_workergroup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/spf13/cobra"
88
"k8s.io/cli-runtime/pkg/genericclioptions"
9+
"k8s.io/client-go/rest"
910

1011
"github.com/ray-project/kuberay/kubectl-plugin/pkg/util/client"
1112

@@ -54,6 +55,9 @@ func NewCreateWorkerGroupOptions(streams genericclioptions.IOStreams) *CreateWor
5455
func NewCreateWorkerGroupCommand(streams genericclioptions.IOStreams) *cobra.Command {
5556
options := NewCreateWorkerGroupOptions(streams)
5657
cmdFactory := cmdutil.NewFactory(options.configFlags)
58+
// Silence warnings to avoid messages like 'unknown field "spec.headGroupSpec.template.metadata.creationTimestamp"'
59+
// See https://github.com/kubernetes/kubernetes/issues/67610 for more details.
60+
rest.SetDefaultWarningHandler(rest.NoWarnings{})
5761

5862
cmd := &cobra.Command{
5963
Use: "workergroup [WORKERGROUP]",

0 commit comments

Comments
 (0)