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
7062cd57
Commit
7062cd57
authored
Aug 29, 2018
by
Jesse Haka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport
https://github.com/kubernetes/cloud-provider-openstack/pull/43
parent
11387279
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
openstack_instances.go
pkg/cloudprovider/providers/openstack/openstack_instances.go
+2
-7
No files found.
pkg/cloudprovider/providers/openstack/openstack_instances.go
View file @
7062cd57
...
@@ -106,7 +106,7 @@ func (i *Instances) NodeAddressesByProviderID(ctx context.Context, providerID st
...
@@ -106,7 +106,7 @@ func (i *Instances) NodeAddressesByProviderID(ctx context.Context, providerID st
return
addresses
,
nil
return
addresses
,
nil
}
}
// InstanceExistsByProviderID returns true if the instance with the given provider id still exist
s and is running
.
// InstanceExistsByProviderID returns true if the instance with the given provider id still exist.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
// If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
error
)
{
func
(
i
*
Instances
)
InstanceExistsByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
error
)
{
instanceID
,
err
:=
instanceIDFromProviderID
(
providerID
)
instanceID
,
err
:=
instanceIDFromProviderID
(
providerID
)
...
@@ -114,7 +114,7 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s
...
@@ -114,7 +114,7 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s
return
false
,
err
return
false
,
err
}
}
server
,
err
:=
servers
.
Get
(
i
.
compute
,
instanceID
)
.
Extract
()
_
,
err
:=
servers
.
Get
(
i
.
compute
,
instanceID
)
.
Extract
()
if
err
!=
nil
{
if
err
!=
nil
{
if
isNotFound
(
err
)
{
if
isNotFound
(
err
)
{
return
false
,
nil
return
false
,
nil
...
@@ -122,11 +122,6 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s
...
@@ -122,11 +122,6 @@ func (i *Instances) InstanceExistsByProviderID(ctx context.Context, providerID s
return
false
,
err
return
false
,
err
}
}
if
server
.
Status
!=
"ACTIVE"
{
glog
.
Warningf
(
"the instance %s is not active"
,
instanceID
)
return
false
,
nil
}
return
true
,
nil
return
true
,
nil
}
}
...
...
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