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
98c9ebbc
Commit
98c9ebbc
authored
Apr 09, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style: Aws -> AWS
parent
2afc1840
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
aws.go
pkg/cloudprovider/aws/aws.go
+12
-12
No files found.
pkg/cloudprovider/aws/aws.go
View file @
98c9ebbc
...
...
@@ -90,7 +90,7 @@ type AWSCloud struct {
region
aws
.
Region
// The AWS instance that we are running on
selfA
ws
Instance
*
awsInstance
selfA
WS
Instance
*
awsInstance
mutex
sync
.
Mutex
}
...
...
@@ -602,7 +602,7 @@ type awsInstance struct {
deviceMappings
map
[
string
]
string
}
func
newA
ws
Instance
(
ec2
EC2
,
awsID
string
)
*
awsInstance
{
func
newA
WS
Instance
(
ec2
EC2
,
awsID
string
)
*
awsInstance
{
self
:=
&
awsInstance
{
ec2
:
ec2
,
awsID
:
awsID
}
// We lazy-init deviceMappings
...
...
@@ -724,7 +724,7 @@ type awsDisk struct {
az
string
}
func
newA
ws
Disk
(
ec2
EC2
,
name
string
)
(
*
awsDisk
,
error
)
{
func
newA
WS
Disk
(
ec2
EC2
,
name
string
)
(
*
awsDisk
,
error
)
{
// name looks like aws://availability-zone/id
url
,
err
:=
url
.
Parse
(
name
)
if
err
!=
nil
{
...
...
@@ -820,20 +820,20 @@ func (self *awsDisk) delete() error {
// Gets the awsInstance for the EC2 instance on which we are running
// may return nil in case of error
func
(
aws
*
AWSCloud
)
getSelfA
ws
Instance
()
(
*
awsInstance
,
error
)
{
func
(
aws
*
AWSCloud
)
getSelfA
WS
Instance
()
(
*
awsInstance
,
error
)
{
// Note that we cache some state in awsInstance (mountpoints), so we must preserve the instance
aws
.
mutex
.
Lock
()
defer
aws
.
mutex
.
Unlock
()
i
:=
aws
.
selfA
ws
Instance
i
:=
aws
.
selfA
WS
Instance
if
i
==
nil
{
instanceIdBytes
,
err
:=
aws
.
metadata
.
GetMetaData
(
"instance-id"
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error fetching instance-id from ec2 metadata service: %v"
,
err
)
}
i
=
newA
ws
Instance
(
aws
.
ec2
,
string
(
instanceIdBytes
))
aws
.
selfA
ws
Instance
=
i
i
=
newA
WS
Instance
(
aws
.
ec2
,
string
(
instanceIdBytes
))
aws
.
selfA
WS
Instance
=
i
}
return
i
,
nil
...
...
@@ -841,14 +841,14 @@ func (aws *AWSCloud) getSelfAwsInstance() (*awsInstance, error) {
// Implements Volumes.AttachDisk
func
(
aws
*
AWSCloud
)
AttachDisk
(
instanceName
string
,
diskName
string
,
readOnly
bool
)
(
string
,
error
)
{
disk
,
err
:=
newA
ws
Disk
(
aws
.
ec2
,
diskName
)
disk
,
err
:=
newA
WS
Disk
(
aws
.
ec2
,
diskName
)
if
err
!=
nil
{
return
""
,
err
}
var
awsInstance
*
awsInstance
if
instanceName
==
""
{
awsInstance
,
err
=
aws
.
getSelfA
ws
Instance
()
awsInstance
,
err
=
aws
.
getSelfA
WS
Instance
()
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"Error getting self-instance: %v"
,
err
)
}
...
...
@@ -858,7 +858,7 @@ func (aws *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly b
return
""
,
fmt
.
Errorf
(
"Error finding instance: %v"
,
err
)
}
awsInstance
=
newA
ws
Instance
(
aws
.
ec2
,
instance
.
InstanceId
)
awsInstance
=
newA
WS
Instance
(
aws
.
ec2
,
instance
.
InstanceId
)
}
if
readOnly
{
...
...
@@ -906,7 +906,7 @@ func (aws *AWSCloud) AttachDisk(instanceName string, diskName string, readOnly b
// Implements Volumes.DetachDisk
func
(
aws
*
AWSCloud
)
DetachDisk
(
instanceName
string
,
diskName
string
)
error
{
disk
,
err
:=
newA
ws
Disk
(
aws
.
ec2
,
diskName
)
disk
,
err
:=
newA
WS
Disk
(
aws
.
ec2
,
diskName
)
if
err
!=
nil
{
return
err
}
...
...
@@ -947,7 +947,7 @@ func (aws *AWSCloud) CreateVolume(volumeOptions *VolumeOptions) (string, error)
// Implements Volumes.DeleteVolume
func
(
aws
*
AWSCloud
)
DeleteVolume
(
volumeName
string
)
error
{
awsDisk
,
err
:=
newA
ws
Disk
(
aws
.
ec2
,
volumeName
)
awsDisk
,
err
:=
newA
WS
Disk
(
aws
.
ec2
,
volumeName
)
if
err
!=
nil
{
return
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