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
7119a453
Commit
7119a453
authored
Jul 28, 2017
by
Nathan Button
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We never want to modify the globally defined SG
parent
4a73f19a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
aws.go
pkg/cloudprovider/providers/aws/aws.go
+16
-1
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
7119a453
...
...
@@ -2101,6 +2101,11 @@ func isEqualUserGroupPair(l, r *ec2.UserIdGroupPair, compareGroupUserIDs bool) b
// Returns true if and only if changes were made
// The security group must already exist
func
(
c
*
Cloud
)
setSecurityGroupIngress
(
securityGroupID
string
,
permissions
IPPermissionSet
)
(
bool
,
error
)
{
// We do not want to make changes to the Global defined SG
if
securityGroupID
==
c
.
cfg
.
Global
.
ElbSecurityGroup
{
return
false
,
nil
}
group
,
err
:=
c
.
findSecurityGroup
(
securityGroupID
)
if
err
!=
nil
{
glog
.
Warningf
(
"Error retrieving security group %q"
,
err
)
...
...
@@ -2171,6 +2176,11 @@ func (c *Cloud) setSecurityGroupIngress(securityGroupID string, permissions IPPe
// Returns true if and only if changes were made
// The security group must already exist
func
(
c
*
Cloud
)
addSecurityGroupIngress
(
securityGroupID
string
,
addPermissions
[]
*
ec2
.
IpPermission
)
(
bool
,
error
)
{
// We do not want to make changes to the Global defined SG
if
securityGroupID
==
c
.
cfg
.
Global
.
ElbSecurityGroup
{
return
false
,
nil
}
group
,
err
:=
c
.
findSecurityGroup
(
securityGroupID
)
if
err
!=
nil
{
glog
.
Warningf
(
"Error retrieving security group: %q"
,
err
)
...
...
@@ -2227,6 +2237,11 @@ func (c *Cloud) addSecurityGroupIngress(securityGroupID string, addPermissions [
// Returns true if and only if changes were made
// If the security group no longer exists, will return (false, nil)
func
(
c
*
Cloud
)
removeSecurityGroupIngress
(
securityGroupID
string
,
removePermissions
[]
*
ec2
.
IpPermission
)
(
bool
,
error
)
{
// We do not want to make changes to the Global defined SG
if
securityGroupID
==
c
.
cfg
.
Global
.
ElbSecurityGroup
{
return
false
,
nil
}
group
,
err
:=
c
.
findSecurityGroup
(
securityGroupID
)
if
err
!=
nil
{
glog
.
Warningf
(
"Error retrieving security group: %q"
,
err
)
...
...
@@ -2554,7 +2569,7 @@ func getPortSets(annotation string) (ports *portSets) {
// buildELBSecurityGroupList returns list of SecurityGroups which should be
// attached to ELB created by a service. List always consist of at least
// 1 member which is an SG created for this service. Extra groups can be
// 1 member which is an SG created for this service
or a SG from the Global config
. Extra groups can be
// specified via annotation
func
(
c
*
Cloud
)
buildELBSecurityGroupList
(
serviceName
types
.
NamespacedName
,
loadBalancerName
,
annotation
string
)
([]
string
,
error
)
{
var
err
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