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
9585658e
Commit
9585658e
authored
Aug 29, 2017
by
Yassine TIJANI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation of GetZoneByProviderID and GetZoneByNodeName for AWS
parent
c071a771
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
aws.go
pkg/cloudprovider/providers/aws/aws.go
+26
-2
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
9585658e
...
@@ -1211,14 +1211,38 @@ func (c *Cloud) GetZone() (cloudprovider.Zone, error) {
...
@@ -1211,14 +1211,38 @@ func (c *Cloud) GetZone() (cloudprovider.Zone, error) {
// This is particularly useful in external cloud providers where the kubelet
// This is particularly useful in external cloud providers where the kubelet
// does not initialize node data.
// does not initialize node data.
func
(
c
*
Cloud
)
GetZoneByProviderID
(
providerID
string
)
(
cloudprovider
.
Zone
,
error
)
{
func
(
c
*
Cloud
)
GetZoneByProviderID
(
providerID
string
)
(
cloudprovider
.
Zone
,
error
)
{
return
cloudprovider
.
Zone
{},
errors
.
New
(
"GetZoneByProviderID not implemented"
)
instanceID
,
err
:=
kubernetesInstanceID
(
providerID
)
.
mapToAWSInstanceID
()
if
err
!=
nil
{
return
cloudprovider
.
Zone
{},
err
}
instance
,
err
:=
c
.
getInstanceByID
(
string
(
instanceID
))
if
err
!=
nil
{
return
cloudprovider
.
Zone
{},
err
}
zone
:=
cloudprovider
.
Zone
{
FailureDomain
:
*
(
instance
.
Placement
.
AvailabilityZone
),
Region
:
c
.
region
,
}
return
zone
,
nil
}
}
// GetZoneByNodeName implements Zones.GetZoneByNodeName
// GetZoneByNodeName implements Zones.GetZoneByNodeName
// This is particularly useful in external cloud providers where the kubelet
// This is particularly useful in external cloud providers where the kubelet
// does not initialize node data.
// does not initialize node data.
func
(
c
*
Cloud
)
GetZoneByNodeName
(
nodeName
types
.
NodeName
)
(
cloudprovider
.
Zone
,
error
)
{
func
(
c
*
Cloud
)
GetZoneByNodeName
(
nodeName
types
.
NodeName
)
(
cloudprovider
.
Zone
,
error
)
{
return
cloudprovider
.
Zone
{},
errors
.
New
(
"GetZoneByNodeName not imeplemented"
)
instance
,
err
:=
c
.
getInstanceByNodeName
(
nodeName
)
if
err
!=
nil
{
return
cloudprovider
.
Zone
{},
err
}
zone
:=
cloudprovider
.
Zone
{
FailureDomain
:
*
(
instance
.
Placement
.
AvailabilityZone
),
Region
:
c
.
region
,
}
return
zone
,
nil
}
}
// Abstraction around AWS Instance Types
// Abstraction around AWS Instance Types
...
...
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