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
ff9a7fe6
Commit
ff9a7fe6
authored
Jan 28, 2016
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the actual kubernetes object when deleting to ensure it matches what is expected to delete
parent
1331edbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
configurator.go
resourcifier/configurator/configurator.go
+6
-1
kubernetes.go
util/kubernetes.go
+1
-1
kubernetes_kubectl.go
util/kubernetes_kubectl.go
+3
-5
No files found.
resourcifier/configurator/configurator.go
View file @
ff9a7fe6
...
@@ -165,7 +165,12 @@ func (a *Configurator) configureResource(resource *common.Resource, o operation)
...
@@ -165,7 +165,12 @@ func (a *Configurator) configureResource(resource *common.Resource, o operation)
case
GetOperation
:
case
GetOperation
:
return
a
.
k
.
Get
(
resource
.
Name
,
resource
.
Type
)
return
a
.
k
.
Get
(
resource
.
Name
,
resource
.
Type
)
case
DeleteOperation
:
case
DeleteOperation
:
ret
,
err
=
a
.
k
.
Delete
(
resource
.
Name
,
resource
.
Type
)
obj
,
err
:=
marshalResource
(
resource
)
if
err
!=
nil
{
resource
.
State
=
failState
(
err
)
return
""
,
err
}
ret
,
err
=
a
.
k
.
Delete
(
obj
)
// Treat deleting a non-existent resource as success.
// Treat deleting a non-existent resource as success.
if
err
!=
nil
{
if
err
!=
nil
{
if
strings
.
HasSuffix
(
strings
.
TrimSpace
(
ret
),
"not found"
)
{
if
strings
.
HasSuffix
(
strings
.
TrimSpace
(
ret
),
"not found"
)
{
...
...
util/kubernetes.go
View file @
ff9a7fe6
...
@@ -37,6 +37,6 @@ type KubernetesConfig struct {
...
@@ -37,6 +37,6 @@ type KubernetesConfig struct {
type
Kubernetes
interface
{
type
Kubernetes
interface
{
Get
(
name
string
,
resourceType
string
)
(
string
,
error
)
Get
(
name
string
,
resourceType
string
)
(
string
,
error
)
Create
(
resource
string
)
(
string
,
error
)
Create
(
resource
string
)
(
string
,
error
)
Delete
(
name
string
,
resourceTyp
e
string
)
(
string
,
error
)
Delete
(
resourc
e
string
)
(
string
,
error
)
Replace
(
resource
string
)
(
string
,
error
)
Replace
(
resource
string
)
(
string
,
error
)
}
}
util/kubernetes_kubectl.go
View file @
ff9a7fe6
...
@@ -100,11 +100,9 @@ func (k *KubernetesKubectl) Create(resource string) (string, error) {
...
@@ -100,11 +100,9 @@ func (k *KubernetesKubectl) Create(resource string) (string, error) {
return
k
.
execute
(
args
,
resource
)
return
k
.
execute
(
args
,
resource
)
}
}
func
(
k
*
KubernetesKubectl
)
Delete
(
name
string
,
resourceType
string
)
(
string
,
error
)
{
func
(
k
*
KubernetesKubectl
)
Delete
(
resource
string
)
(
string
,
error
)
{
args
:=
[]
string
{
"delete"
,
args
:=
[]
string
{
"delete"
}
resourceType
,
return
k
.
execute
(
args
,
resource
)
name
}
return
k
.
execute
(
args
,
""
)
}
}
func
(
k
*
KubernetesKubectl
)
Replace
(
resource
string
)
(
string
,
error
)
{
func
(
k
*
KubernetesKubectl
)
Replace
(
resource
string
)
(
string
,
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