mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
add boundary check before access os.Args
This commit is contained in:
@@ -41,7 +41,7 @@ func NewCmdApiVersions(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
}
|
||||
|
||||
func RunApiVersions(f *cmdutil.Factory, out io.Writer) error {
|
||||
if os.Args[1] == "apiversions" {
|
||||
if len(os.Args) > 1 && os.Args[1] == "apiversions" {
|
||||
printDeprecationWarning("api-versions", "apiversions")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user