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
f623b9b4
Commit
f623b9b4
authored
Jul 06, 2017
by
Fabiano Franz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run must output message on container error
parent
a9bf4410
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
run.go
pkg/kubectl/cmd/run.go
+1
-1
helpers.go
pkg/kubectl/cmd/util/helpers.go
+1
-2
helpers_test.go
pkg/kubectl/cmd/util/helpers_test.go
+1
-1
No files found.
pkg/kubectl/cmd/run.go
View file @
f623b9b4
...
...
@@ -362,7 +362,7 @@ func RunRun(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *c
return
unknownRcErr
}
return
uexec
.
CodeExitError
{
Err
:
fmt
.
Errorf
(
"pod %s/%s terminated
"
,
pod
.
Namespace
,
pod
.
Nam
e
),
Err
:
fmt
.
Errorf
(
"pod %s/%s terminated
(%s)
\n
%s"
,
pod
.
Namespace
,
pod
.
Name
,
pod
.
Status
.
ContainerStatuses
[
0
]
.
State
.
Terminated
.
Reason
,
pod
.
Status
.
ContainerStatuses
[
0
]
.
State
.
Terminated
.
Messag
e
),
Code
:
int
(
rc
),
}
default
:
...
...
pkg/kubectl/cmd/util/helpers.go
View file @
f623b9b4
...
...
@@ -167,8 +167,7 @@ func checkErr(err error, handleErr func(string, int)) {
case
utilerrors
.
Aggregate
:
handleErr
(
MultipleErrors
(
``
,
err
.
Errors
()),
DefaultErrorExitCode
)
case
utilexec
.
ExitError
:
// do not print anything, only terminate with given error
handleErr
(
""
,
err
.
ExitStatus
())
handleErr
(
err
.
Error
(),
err
.
ExitStatus
())
default
:
// for any other error type
msg
,
ok
:=
StandardErrorMessage
(
err
)
if
!
ok
{
...
...
pkg/kubectl/cmd/util/helpers_test.go
View file @
f623b9b4
...
...
@@ -269,7 +269,7 @@ func TestCheckExitError(t *testing.T) {
testCheckError
(
t
,
[]
checkErrTestCase
{
{
uexec
.
CodeExitError
{
Err
:
fmt
.
Errorf
(
"pod foo/bar terminated"
),
Code
:
42
},
""
,
"
pod foo/bar terminated
"
,
42
,
},
})
...
...
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