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
6ea50535
Commit
6ea50535
authored
Aug 10, 2018
by
andrewsykim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document expectations for stopped/shutdown instances in cloudprovider.Instances interface
parent
cd06fd4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
cloud.go
pkg/cloudprovider/cloud.go
+4
-2
No files found.
pkg/cloudprovider/cloud.go
View file @
6ea50535
...
@@ -134,7 +134,8 @@ type Instances interface {
...
@@ -134,7 +134,8 @@ type Instances interface {
// services cannot be used in this method to obtain nodeaddresses
// services cannot be used in this method to obtain nodeaddresses
NodeAddressesByProviderID
(
ctx
context
.
Context
,
providerID
string
)
([]
v1
.
NodeAddress
,
error
)
NodeAddressesByProviderID
(
ctx
context
.
Context
,
providerID
string
)
([]
v1
.
NodeAddress
,
error
)
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
// Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)
// Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound)
// cloudprovider.InstanceNotFound should NOT be returned for instances that exist but are stopped/sleeping
InstanceID
(
ctx
context
.
Context
,
nodeName
types
.
NodeName
)
(
string
,
error
)
InstanceID
(
ctx
context
.
Context
,
nodeName
types
.
NodeName
)
(
string
,
error
)
// InstanceType returns the type of the specified instance.
// InstanceType returns the type of the specified instance.
InstanceType
(
ctx
context
.
Context
,
name
types
.
NodeName
)
(
string
,
error
)
InstanceType
(
ctx
context
.
Context
,
name
types
.
NodeName
)
(
string
,
error
)
...
@@ -146,8 +147,9 @@ type Instances interface {
...
@@ -146,8 +147,9 @@ type Instances interface {
// CurrentNodeName returns the name of the node we are currently running on
// CurrentNodeName returns the name of the node we are currently running on
// On most clouds (e.g. GCE) this is the hostname, so we provide the hostname
// On most clouds (e.g. GCE) this is the hostname, so we provide the hostname
CurrentNodeName
(
ctx
context
.
Context
,
hostname
string
)
(
types
.
NodeName
,
error
)
CurrentNodeName
(
ctx
context
.
Context
,
hostname
string
)
(
types
.
NodeName
,
error
)
// InstanceExistsByProviderID returns true if the instance for the given provider
id still is running
.
// InstanceExistsByProviderID returns true if the instance for the given provider
exists
.
// 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.
// This method should still return true for instances that exist but are stopped/sleeping.
InstanceExistsByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
error
)
InstanceExistsByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
error
)
// InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider
// InstanceShutdownByProviderID returns true if the instance is shutdown in cloudprovider
InstanceShutdownByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
error
)
InstanceShutdownByProviderID
(
ctx
context
.
Context
,
providerID
string
)
(
bool
,
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