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
00b666f8
Commit
00b666f8
authored
Feb 27, 2016
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AWS: Rename getInfo -> describeInstance/describeVolume
Makes it clearer that we are making an AWS API call
parent
efa68a35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
aws.go
pkg/cloudprovider/providers/aws/aws.go
+8
-7
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
00b666f8
...
@@ -648,11 +648,12 @@ func newAWSCloud(config io.Reader, awsServices AWSServices) (*AWSCloud, error) {
...
@@ -648,11 +648,12 @@ func newAWSCloud(config io.Reader, awsServices AWSServices) (*AWSCloud, error) {
if
cfg
.
Global
.
KubernetesClusterTag
!=
""
{
if
cfg
.
Global
.
KubernetesClusterTag
!=
""
{
filterTags
[
TagNameKubernetesCluster
]
=
cfg
.
Global
.
KubernetesClusterTag
filterTags
[
TagNameKubernetesCluster
]
=
cfg
.
Global
.
KubernetesClusterTag
}
else
{
}
else
{
selfInstanceInfo
,
err
:=
selfAWSInstance
.
getInfo
()
// TODO: Clean up double-API query
info
,
err
:=
selfAWSInstance
.
describeInstance
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
for
_
,
tag
:=
range
selfInstanceI
nfo
.
Tags
{
for
_
,
tag
:=
range
i
nfo
.
Tags
{
if
orEmpty
(
tag
.
Key
)
==
TagNameKubernetesCluster
{
if
orEmpty
(
tag
.
Key
)
==
TagNameKubernetesCluster
{
filterTags
[
TagNameKubernetesCluster
]
=
orEmpty
(
tag
.
Value
)
filterTags
[
TagNameKubernetesCluster
]
=
orEmpty
(
tag
.
Value
)
}
}
...
@@ -989,7 +990,7 @@ func (self *awsInstance) getInstanceType() *awsInstanceType {
...
@@ -989,7 +990,7 @@ func (self *awsInstance) getInstanceType() *awsInstanceType {
}
}
// Gets the full information about this instance from the EC2 API
// Gets the full information about this instance from the EC2 API
func
(
self
*
awsInstance
)
getInfo
()
(
*
ec2
.
Instance
,
error
)
{
func
(
self
*
awsInstance
)
describeInstance
()
(
*
ec2
.
Instance
,
error
)
{
instanceID
:=
self
.
awsID
instanceID
:=
self
.
awsID
request
:=
&
ec2
.
DescribeInstancesInput
{
request
:=
&
ec2
.
DescribeInstancesInput
{
InstanceIds
:
[]
*
string
{
&
instanceID
},
InstanceIds
:
[]
*
string
{
&
instanceID
},
...
@@ -1025,7 +1026,7 @@ func (self *awsInstance) getMountDevice(volumeID string, assign bool) (assigned
...
@@ -1025,7 +1026,7 @@ func (self *awsInstance) getMountDevice(volumeID string, assign bool) (assigned
// We cache both for efficiency and correctness
// We cache both for efficiency and correctness
if
self
.
deviceMappings
==
nil
{
if
self
.
deviceMappings
==
nil
{
info
,
err
:=
self
.
getInfo
()
info
,
err
:=
self
.
describeInstance
()
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
false
,
err
return
""
,
false
,
err
}
}
...
@@ -1145,7 +1146,7 @@ func newAWSDisk(aws *AWSCloud, name string) (*awsDisk, error) {
...
@@ -1145,7 +1146,7 @@ func newAWSDisk(aws *AWSCloud, name string) (*awsDisk, error) {
}
}
// Gets the full information about this volume from the EC2 API
// Gets the full information about this volume from the EC2 API
func
(
self
*
awsDisk
)
getInfo
()
(
*
ec2
.
Volume
,
error
)
{
func
(
self
*
awsDisk
)
describeVolume
()
(
*
ec2
.
Volume
,
error
)
{
volumeID
:=
self
.
awsID
volumeID
:=
self
.
awsID
request
:=
&
ec2
.
DescribeVolumesInput
{
request
:=
&
ec2
.
DescribeVolumesInput
{
...
@@ -1171,7 +1172,7 @@ func (self *awsDisk) waitForAttachmentStatus(status string) error {
...
@@ -1171,7 +1172,7 @@ func (self *awsDisk) waitForAttachmentStatus(status string) error {
maxAttempts
:=
60
maxAttempts
:=
60
for
{
for
{
info
,
err
:=
self
.
getInfo
()
info
,
err
:=
self
.
describeVolume
()
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -1451,7 +1452,7 @@ func (c *AWSCloud) GetVolumeLabels(volumeName string) (map[string]string, error)
...
@@ -1451,7 +1452,7 @@ func (c *AWSCloud) GetVolumeLabels(volumeName string) (map[string]string, error)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
info
,
err
:=
awsDisk
.
getInfo
()
info
,
err
:=
awsDisk
.
describeVolume
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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