Commit caf4b1e4 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #18191 from thockin/ingress-egress-annotations

Auto commit by PR queue bot
parents 4e553f0d 29a2fded
...@@ -3298,7 +3298,7 @@ func validateBandwidthIsReasonable(rsrc *resource.Quantity) error { ...@@ -3298,7 +3298,7 @@ func validateBandwidthIsReasonable(rsrc *resource.Quantity) error {
} }
func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity, err error) { func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity, err error) {
str, found := pod.Annotations["net.alpha.kubernetes.io/ingress-bandwidth"] str, found := pod.Annotations["kubernetes.io/ingress-bandwidth"]
if found { if found {
if ingress, err = resource.ParseQuantity(str); err != nil { if ingress, err = resource.ParseQuantity(str); err != nil {
return nil, nil, err return nil, nil, err
...@@ -3307,7 +3307,7 @@ func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity ...@@ -3307,7 +3307,7 @@ func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity
return nil, nil, err return nil, nil, err
} }
} }
str, found = pod.Annotations["net.alpha.kubernetes.io/egress-bandwidth"] str, found = pod.Annotations["kubernetes.io/egress-bandwidth"]
if found { if found {
if egress, err = resource.ParseQuantity(str); err != nil { if egress, err = resource.ParseQuantity(str); err != nil {
return nil, nil, err return nil, nil, err
......
...@@ -3901,7 +3901,7 @@ func TestCleanupBandwidthLimits(t *testing.T) { ...@@ -3901,7 +3901,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "10M", "kubernetes.io/ingress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -3926,7 +3926,7 @@ func TestCleanupBandwidthLimits(t *testing.T) { ...@@ -3926,7 +3926,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "10M", "kubernetes.io/ingress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -3952,7 +3952,7 @@ func TestCleanupBandwidthLimits(t *testing.T) { ...@@ -3952,7 +3952,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "10M", "kubernetes.io/ingress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -3977,7 +3977,7 @@ func TestCleanupBandwidthLimits(t *testing.T) { ...@@ -3977,7 +3977,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "10M", "kubernetes.io/ingress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -4065,7 +4065,7 @@ func TestExtractBandwidthResources(t *testing.T) { ...@@ -4065,7 +4065,7 @@ func TestExtractBandwidthResources(t *testing.T) {
pod: &api.Pod{ pod: &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "10M", "kubernetes.io/ingress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -4075,7 +4075,7 @@ func TestExtractBandwidthResources(t *testing.T) { ...@@ -4075,7 +4075,7 @@ func TestExtractBandwidthResources(t *testing.T) {
pod: &api.Pod{ pod: &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/egress-bandwidth": "10M", "kubernetes.io/egress-bandwidth": "10M",
}, },
}, },
}, },
...@@ -4085,8 +4085,8 @@ func TestExtractBandwidthResources(t *testing.T) { ...@@ -4085,8 +4085,8 @@ func TestExtractBandwidthResources(t *testing.T) {
pod: &api.Pod{ pod: &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "4M", "kubernetes.io/ingress-bandwidth": "4M",
"net.alpha.kubernetes.io/egress-bandwidth": "20M", "kubernetes.io/egress-bandwidth": "20M",
}, },
}, },
}, },
...@@ -4097,7 +4097,7 @@ func TestExtractBandwidthResources(t *testing.T) { ...@@ -4097,7 +4097,7 @@ func TestExtractBandwidthResources(t *testing.T) {
pod: &api.Pod{ pod: &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Annotations: map[string]string{ Annotations: map[string]string{
"net.alpha.kubernetes.io/ingress-bandwidth": "foo", "kubernetes.io/ingress-bandwidth": "foo",
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment