Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2120 from martinkennelly/merge_12_04_24
SDN-3931,OCPBUGS-29952,OCPBUGS-25889: Downstream merge 12 04 24
- Loading branch information
Showing
55 changed files
with
1,295 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package util | ||
|
||
import ( | ||
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/libovsdb/ops" | ||
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/nbdb" | ||
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/util" | ||
) | ||
|
||
func GetPortGroupName(dbIDs *ops.DbObjectIDs) string { | ||
return util.HashForOVN(dbIDs.GetExternalIDs()[ops.PrimaryIDKey.String()]) | ||
} | ||
|
||
func BuildPortGroup(pgIDs *ops.DbObjectIDs, ports []*nbdb.LogicalSwitchPort, acls []*nbdb.ACL) *nbdb.PortGroup { | ||
externalIDs := pgIDs.GetExternalIDs() | ||
pg := nbdb.PortGroup{ | ||
Name: util.HashForOVN(externalIDs[ops.PrimaryIDKey.String()]), | ||
ExternalIDs: externalIDs, | ||
} | ||
|
||
if len(acls) > 0 { | ||
pg.ACLs = make([]string, 0, len(acls)) | ||
for _, acl := range acls { | ||
pg.ACLs = append(pg.ACLs, acl.UUID) | ||
} | ||
} | ||
|
||
if len(ports) > 0 { | ||
pg.Ports = make([]string, 0, len(ports)) | ||
for _, port := range ports { | ||
pg.Ports = append(pg.Ports, port.UUID) | ||
} | ||
} | ||
|
||
return &pg | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.