mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Change to alpha/beta for bandwidth annotations
This commit is contained in:
parent
0bf5bfff5d
commit
2f4c3035be
@ -2851,7 +2851,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["kubernetes.io/ingress-bandwidth"]
|
str, found := pod.Annotations["net.alpha.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
|
||||||
@ -2860,7 +2860,7 @@ func extractBandwidthResources(pod *api.Pod) (ingress, egress *resource.Quantity
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
str, found = pod.Annotations["kubernetes.io/egress-bandwidth"]
|
str, found = pod.Annotations["net.alpha.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
|
||||||
|
@ -3442,7 +3442,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"kubernetes.io/ingress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3467,7 +3467,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"kubernetes.io/ingress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3493,7 +3493,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"kubernetes.io/ingress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3518,7 +3518,7 @@ func TestCleanupBandwidthLimits(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"kubernetes.io/ingress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3606,7 +3606,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{
|
||||||
"kubernetes.io/ingress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3616,7 +3616,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{
|
||||||
"kubernetes.io/egress-bandwidth": "10M",
|
"net.alpha.kubernetes.io/egress-bandwidth": "10M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3626,8 +3626,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{
|
||||||
"kubernetes.io/ingress-bandwidth": "4M",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "4M",
|
||||||
"kubernetes.io/egress-bandwidth": "20M",
|
"net.alpha.kubernetes.io/egress-bandwidth": "20M",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -3638,7 +3638,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{
|
||||||
"kubernetes.io/ingress-bandwidth": "foo",
|
"net.alpha.kubernetes.io/ingress-bandwidth": "foo",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user