Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
769237ac
Commit
769237ac
authored
Nov 17, 2015
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Treat delete not_found failure as a success
parent
ee6bf092
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
configurator.go
resourcifier/configurator/configurator.go
+9
-5
No files found.
resourcifier/configurator/configurator.go
View file @
769237ac
...
...
@@ -127,8 +127,6 @@ func (a *Configurator) Configure(c *Configuration, o operation) (string, error)
cmd
.
Stdout
=
combined
cmd
.
Stderr
=
combined
// log.Printf("starting command:%s %s\nin directory: %s\nwith environment: %s\nwith stdin:\n%s\n",
// cmd.Path, strings.Join(cmd.Args, " "), cmd.Dir, strings.Join(cmd.Env, "\n"), string(y))
if
err
:=
cmd
.
Start
();
err
!=
nil
{
e
:=
fmt
.
Errorf
(
"cannot start kubetcl for resource: %v: %v"
,
resource
.
Name
,
err
)
log
.
Println
(
errors
.
appendError
(
e
))
...
...
@@ -136,9 +134,15 @@ func (a *Configurator) Configure(c *Configuration, o operation) (string, error)
}
if
err
:=
cmd
.
Wait
();
err
!=
nil
{
e
:=
fmt
.
Errorf
(
"kubetcl failed for resource: %v: %v: %v"
,
resource
.
Name
,
err
,
combined
.
String
())
log
.
Println
(
errors
.
appendError
(
e
))
continue
// Treat delete special. If a delete is issued and a resource is not found, treat it as
// success.
if
(
o
==
DeleteOperation
&&
strings
.
HasSuffix
(
strings
.
TrimSpace
(
combined
.
String
()),
"not found"
))
{
log
.
Println
(
resource
.
Name
+
" not found, treating as success for delete"
)
}
else
{
e
:=
fmt
.
Errorf
(
"kubetcl failed for resource: %v: %v: %v"
,
resource
.
Name
,
err
,
combined
.
String
())
log
.
Println
(
errors
.
appendError
(
e
))
continue
}
}
output
=
append
(
output
,
combined
.
String
())
...
...
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