Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Docker-Machine Driver Hetzner
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
JonasProgrammer
Docker-Machine Driver Hetzner
Commits
475d0ba4
Unverified
Commit
475d0ba4
authored
Oct 23, 2018
by
Jonas Stoehr
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Downloads
Plain Diff
Merge pull request #20 from mhutter/fix/orphan-ssh-key
Clean up SSH key when a server is alredy removed
parents
5de469ac
9d8e8098
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
driver.go
+8
-4
8 additions, 4 deletions
driver.go
with
8 additions
and
4 deletions
driver.go
+
8
−
4
View file @
475d0ba4
...
@@ -341,12 +341,16 @@ func (d *Driver) Remove() error {
...
@@ -341,12 +341,16 @@ func (d *Driver) Remove() error {
return
errors
.
Wrap
(
err
,
"could not get server handle"
)
return
errors
.
Wrap
(
err
,
"could not get server handle"
)
}
}
if
srv
==
nil
{
log
.
Infof
(
" -> Server does not exist anymore"
)
}
else
{
log
.
Infof
(
" -> Destroying server %s[%d] in..."
,
srv
.
Name
,
srv
.
ID
)
log
.
Infof
(
" -> Destroying server %s[%d] in..."
,
srv
.
Name
,
srv
.
ID
)
if
_
,
err
:=
d
.
getClient
()
.
Server
.
Delete
(
context
.
Background
(),
srv
);
err
!=
nil
{
if
_
,
err
:=
d
.
getClient
()
.
Server
.
Delete
(
context
.
Background
(),
srv
);
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"could not delete server"
)
return
errors
.
Wrap
(
err
,
"could not delete server"
)
}
}
}
}
}
if
!
d
.
IsExistingKey
&&
d
.
KeyID
!=
0
{
if
!
d
.
IsExistingKey
&&
d
.
KeyID
!=
0
{
key
,
err
:=
d
.
getKey
()
key
,
err
:=
d
.
getKey
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment