Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6ca2c36e
Commit
6ca2c36e
authored
Aug 29, 2016
by
PingWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return all the invalid flags for rollingupdate
Signed-off-by:
PingWang
<
wang.ping5@zte.com.cn
>
parent
6fcbbe86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
rollingupdate.go
pkg/kubectl/cmd/rollingupdate.go
+10
-9
No files found.
pkg/kubectl/cmd/rollingupdate.go
View file @
6ca2c36e
...
@@ -34,6 +34,7 @@ import (
...
@@ -34,6 +34,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/pkg/kubectl"
cmdutil
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
cmdutil
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/kubectl/resource"
utilerrors
"k8s.io/kubernetes/pkg/util/errors"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/intstr"
)
)
...
@@ -115,31 +116,31 @@ func validateArguments(cmd *cobra.Command, filenames, args []string) error {
...
@@ -115,31 +116,31 @@ func validateArguments(cmd *cobra.Command, filenames, args []string) error {
image
:=
cmdutil
.
GetFlagString
(
cmd
,
"image"
)
image
:=
cmdutil
.
GetFlagString
(
cmd
,
"image"
)
rollback
:=
cmdutil
.
GetFlagBool
(
cmd
,
"rollback"
)
rollback
:=
cmdutil
.
GetFlagBool
(
cmd
,
"rollback"
)
errors
:=
[]
error
{}
if
len
(
deploymentKey
)
==
0
{
if
len
(
deploymentKey
)
==
0
{
return
cmdutil
.
UsageError
(
cmd
,
"--deployment-label-key can not be empty"
)
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"--deployment-label-key can not be empty"
)
)
}
}
if
len
(
filenames
)
>
1
{
if
len
(
filenames
)
>
1
{
return
cmdutil
.
UsageError
(
cmd
,
"May only specify a single filename for new controller"
)
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"May only specify a single filename for new controller"
)
)
}
}
if
!
rollback
{
if
!
rollback
{
if
len
(
filenames
)
==
0
&&
len
(
image
)
==
0
{
if
len
(
filenames
)
==
0
&&
len
(
image
)
==
0
{
return
cmdutil
.
UsageError
(
cmd
,
"Must specify --filename or --image for new controller"
)
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"Must specify --filename or --image for new controller"
))
}
}
else
if
len
(
filenames
)
!=
0
&&
len
(
image
)
!=
0
{
if
len
(
filenames
)
!=
0
&&
len
(
image
)
!=
0
{
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"--filename and --image can not both be specified"
))
return
cmdutil
.
UsageError
(
cmd
,
"--filename and --image can not both be specified"
)
}
}
}
else
{
}
else
{
if
len
(
filenames
)
!=
0
||
len
(
image
)
!=
0
{
if
len
(
filenames
)
!=
0
||
len
(
image
)
!=
0
{
return
cmdutil
.
UsageError
(
cmd
,
"Don't specify --filename or --image on rollback"
)
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"Don't specify --filename or --image on rollback"
)
)
}
}
}
}
if
len
(
args
)
<
1
{
if
len
(
args
)
<
1
{
return
cmdutil
.
UsageError
(
cmd
,
"Must specify the controller to update"
)
errors
=
append
(
errors
,
cmdutil
.
UsageError
(
cmd
,
"Must specify the controller to update"
)
)
}
}
return
nil
return
utilerrors
.
NewAggregate
(
errors
)
}
}
func
RunRollingUpdate
(
f
*
cmdutil
.
Factory
,
out
io
.
Writer
,
cmd
*
cobra
.
Command
,
args
[]
string
,
options
*
RollingUpdateOptions
)
error
{
func
RunRollingUpdate
(
f
*
cmdutil
.
Factory
,
out
io
.
Writer
,
cmd
*
cobra
.
Command
,
args
[]
string
,
options
*
RollingUpdateOptions
)
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment