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
7d04257c
Commit
7d04257c
authored
Jan 04, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17078 from justinsb/remove_route_blackhole
Auto commit by PR queue bot
parents
f293dff5
7444216d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
aws_routes.go
pkg/cloudprovider/providers/aws/aws_routes.go
+27
-0
No files found.
pkg/cloudprovider/providers/aws/aws_routes.go
View file @
7d04257c
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/cloudprovider"
)
)
...
@@ -108,6 +109,32 @@ func (s *AWSCloud) CreateRoute(clusterName string, nameHint string, route *cloud
...
@@ -108,6 +109,32 @@ func (s *AWSCloud) CreateRoute(clusterName string, nameHint string, route *cloud
return
err
return
err
}
}
var
deleteRoute
*
ec2
.
Route
for
_
,
r
:=
range
table
.
Routes
{
destinationCIDR
:=
aws
.
StringValue
(
r
.
DestinationCidrBlock
)
if
destinationCIDR
!=
route
.
DestinationCIDR
{
continue
}
if
aws
.
StringValue
(
r
.
State
)
==
ec2
.
RouteStateBlackhole
{
deleteRoute
=
r
}
}
if
deleteRoute
!=
nil
{
glog
.
Infof
(
"deleting blackholed route: %s"
,
aws
.
StringValue
(
deleteRoute
.
DestinationCidrBlock
))
request
:=
&
ec2
.
DeleteRouteInput
{}
request
.
DestinationCidrBlock
=
deleteRoute
.
DestinationCidrBlock
request
.
RouteTableId
=
table
.
RouteTableId
_
,
err
=
s
.
ec2
.
DeleteRoute
(
request
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error deleting blackholed AWS route (%s): %v"
,
deleteRoute
.
DestinationCidrBlock
,
err
)
}
}
request
:=
&
ec2
.
CreateRouteInput
{}
request
:=
&
ec2
.
CreateRouteInput
{}
// TODO: use ClientToken for idempotency?
// TODO: use ClientToken for idempotency?
request
.
DestinationCidrBlock
=
aws
.
String
(
route
.
DestinationCIDR
)
request
.
DestinationCidrBlock
=
aws
.
String
(
route
.
DestinationCIDR
)
...
...
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