Skip to content

Commit

Permalink
[occm][WIP] Add SG to node ensure the different node's pods can acces…
Browse files Browse the repository at this point in the history
…s each other
  • Loading branch information
jeffyjf committed Dec 13, 2023
1 parent f3e92a2 commit 3c6af74
Show file tree
Hide file tree
Showing 3 changed files with 334 additions and 73 deletions.
11 changes: 1 addition & 10 deletions pkg/openstack/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,6 @@ func getSecurityGroupName(service *corev1.Service) string {
return securityGroupName
}

func getSecurityGroupRules(client *gophercloud.ServiceClient, opts rules.ListOpts) ([]rules.SecGroupRule, error) {
mc := metrics.NewMetricContext("security_group_rule", "list")
page, err := rules.List(client, opts).AllPages()
if mc.ObserveRequest(err) != nil {
return nil, err
}
return rules.ExtractRules(page)
}

func getListenerProtocol(protocol corev1.Protocol, svcConf *serviceConfig) listeners.Protocol {
// Make neutron-lbaas code work
if svcConf != nil {
Expand Down Expand Up @@ -2338,7 +2329,7 @@ func (lbaas *LbaasV2) ensureAndUpdateOctaviaSecurityGroup(clusterName string, ap
cidrs = svcConf.allowedCIDR
}

existingRules, err := getSecurityGroupRules(lbaas.network, rules.ListOpts{SecGroupID: lbSecGroupID})
existingRules, err := openstackutil.GetSecurityGroupRules(lbaas.network, rules.ListOpts{SecGroupID: lbSecGroupID})
if err != nil {
return fmt.Errorf(
"failed to find security group rules in %s: %v", lbSecGroupID, err)
Expand Down
Loading

0 comments on commit 3c6af74

Please sign in to comment.