teach kubenet to use annotation instead of pod object for traffic shaper

This commit is contained in:
Minhan Xia
2017-02-16 11:41:11 -08:00
parent 947e0e1bf5
commit f006c8bcd3
2 changed files with 19 additions and 16 deletions

View File

@@ -36,6 +36,9 @@ func validateBandwidthIsReasonable(rsrc *resource.Quantity) error {
}
func ExtractPodBandwidthResources(podAnnotations map[string]string) (ingress, egress *resource.Quantity, err error) {
if podAnnotations == nil {
return nil, nil, nil
}
str, found := podAnnotations["kubernetes.io/ingress-bandwidth"]
if found {
ingressValue, err := resource.ParseQuantity(str)