mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Merge pull request #18191 from thockin/ingress-egress-annotations
Auto commit by PR queue bot
This commit is contained in:
@@ -3298,7 +3298,7 @@ func validateBandwidthIsReasonable(rsrc *resource.Quantity) 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 ingress, err = resource.ParseQuantity(str); err != nil {
|
||||
return nil, nil, err
|
||||
@@ -3307,7 +3307,7 @@ func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity
|
||||
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 egress, err = resource.ParseQuantity(str); err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
@@ -3901,7 +3901,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
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) {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
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) {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
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) {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
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) {
|
||||
pod: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
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) {
|
||||
pod: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
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) {
|
||||
pod: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
"net.alpha.kubernetes.io/ingress-bandwidth": "4M",
|
||||
"net.alpha.kubernetes.io/egress-bandwidth": "20M",
|
||||
"kubernetes.io/ingress-bandwidth": "4M",
|
||||
"kubernetes.io/egress-bandwidth": "20M",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -4097,7 +4097,7 @@ func TestExtractBandwidthResources(t *testing.T) {
|
||||
pod: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Annotations: map[string]string{
|
||||
"net.alpha.kubernetes.io/ingress-bandwidth": "foo",
|
||||
"kubernetes.io/ingress-bandwidth": "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user