-
Notifications
You must be signed in to change notification settings - Fork 303
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 #827 from cadmuxe/csm
Add CSM NEG support.
- Loading branch information
Showing
116 changed files
with
64,456 additions
and
284 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package annotations | ||
|
||
import "encoding/json" | ||
|
||
//PortSubsetNegMap is the mapping between subset to NEG name. | ||
type PortSubsetNegMap map[string]map[string]string | ||
|
||
// DestinationRuleNEGStatus holds the NEGs Zones info. | ||
// NetworkEndpointGroups(PortSubsetNegMap) is the mapping between subset to NEG name. | ||
// Structure: | ||
// { | ||
// "subsetv1": { | ||
// "9080": "somehash-default-reviews-v1-9080", | ||
// } | ||
// "v2": { | ||
// "9080": "somehash-default-reviews-v2-9080", | ||
// } | ||
// } | ||
type DestinationRuleNEGStatus struct { | ||
NetworkEndpointGroups PortSubsetNegMap `json:"network_endpoint_groups,omitempty"` | ||
// Zones is a list of zones where the NEGs exist. | ||
Zones []string `json:"zones,omitempty"` | ||
} | ||
|
||
// NewDestinationRuleNegStatus generates a NegStatus denoting the current NEGs | ||
// associated with the given PortSubsetNegMap. | ||
func NewDestinationRuleNegStatus(zones []string, portSubsetToNegs PortSubsetNegMap) DestinationRuleNEGStatus { | ||
res := DestinationRuleNEGStatus{} | ||
res.Zones = zones | ||
res.NetworkEndpointGroups = portSubsetToNegs | ||
return res | ||
} | ||
|
||
// Marshal returns the DestinationRuleNEGStatus in json string. | ||
func (ns DestinationRuleNEGStatus) Marshal() (string, error) { | ||
ret := "" | ||
bytes, err := json.Marshal(ns) | ||
if err != nil { | ||
return ret, err | ||
} | ||
return string(bytes), err | ||
} |
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
Oops, something went wrong.