mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
add boundary check before access os.Args
This commit is contained in:
@@ -46,7 +46,7 @@ func NewCmdClusterInfo(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
}
|
||||
|
||||
func RunClusterInfo(factory *cmdutil.Factory, out io.Writer, cmd *cobra.Command) error {
|
||||
if os.Args[1] == "clusterinfo" {
|
||||
if len(os.Args) > 1 && os.Args[1] == "clusterinfo" {
|
||||
printDeprecationWarning("cluster-info", "clusterinfo")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user