Merge pull request #10585 from caesarxuchao/fix-alias
Add boundary check before accessing os.Args[1]
This commit is contained in:
@@ -65,7 +65,7 @@ func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
|
||||
// RunScale executes the scaling
|
||||
func RunScale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
|
||||
if os.Args[1] == "resize" {
|
||||
if len(os.Args) > 1 && os.Args[1] == "resize" {
|
||||
printDeprecationWarning("scale", "resize")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user