From a4d5801e7b95e52fd2d761e214c218c538ab7f7f Mon Sep 17 00:00:00 2001 From: luomingmeng Date: Tue, 4 Jul 2023 15:07:40 +0800 Subject: [PATCH 1/2] add resource_identifier resource annotation key --- go.mod | 2 +- go.sum | 4 ++-- pkg/consts/resource.go | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8aa824d..2272d75 100644 --- a/go.mod +++ b/go.mod @@ -86,7 +86,7 @@ replace ( k8s.io/kube-proxy => k8s.io/kube-proxy v0.24.6 k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.24.6 k8s.io/kubectl => k8s.io/kubectl v0.24.6 - k8s.io/kubelet => github.com/kubewharf/kubelet v1.24.6-kubewharf.2 + k8s.io/kubelet => github.com/kubewharf/kubelet v1.24.6-kubewharf.5 k8s.io/kubernetes => k8s.io/kubernetes v1.24.6 k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.24.6 k8s.io/metrics => k8s.io/metrics v0.24.6 diff --git a/go.sum b/go.sum index 6f9425f..eeae11c 100644 --- a/go.sum +++ b/go.sum @@ -392,8 +392,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubewharf/kubelet v1.24.6-kubewharf.2 h1:2KLdb/ErOpqAj068trr+xA3jyj8+d2aN1Pm5Bu2ZQjM= -github.com/kubewharf/kubelet v1.24.6-kubewharf.2/go.mod h1:MxbSZUx3wXztFneeelwWWlX7NAAStJ6expqq7gY2J3c= +github.com/kubewharf/kubelet v1.24.6-kubewharf.5 h1:i3BcfBY3fFTzPWi5BCYyhkiSZCrIGczaGNAwgUvga6U= +github.com/kubewharf/kubelet v1.24.6-kubewharf.5/go.mod h1:MxbSZUx3wXztFneeelwWWlX7NAAStJ6expqq7gY2J3c= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= diff --git a/pkg/consts/resource.go b/pkg/consts/resource.go index a902ac9..8fc841e 100644 --- a/pkg/consts/resource.go +++ b/pkg/consts/resource.go @@ -26,3 +26,9 @@ const ( const ( ResourceNetBandwidth v1.ResourceName = "resource.katalyst.kubewharf.io/net_bandwidth" ) + +// const variables for the resource annotation key of TopologyAwareQuantity reported +// by the qrm plugin, indicating that it belongs to a unique topology zone in cnr +const ( + ResourceAnnotationKeyResourceIdentifier = "katalyst.kubewharf.io/resource_identifier" +) From 590ac9450fa650fd78a176d9e5979fa7c9efde1d Mon Sep 17 00:00:00 2001 From: "shaowei.wayne" Date: Tue, 4 Jul 2023 16:17:58 +0800 Subject: [PATCH 2/2] refine the comments for resource identifier --- pkg/consts/resource.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/consts/resource.go b/pkg/consts/resource.go index 8fc841e..17a7056 100644 --- a/pkg/consts/resource.go +++ b/pkg/consts/resource.go @@ -27,8 +27,8 @@ const ( ResourceNetBandwidth v1.ResourceName = "resource.katalyst.kubewharf.io/net_bandwidth" ) -// const variables for the resource annotation key of TopologyAwareQuantity reported -// by the qrm plugin, indicating that it belongs to a unique topology zone in cnr -const ( - ResourceAnnotationKeyResourceIdentifier = "katalyst.kubewharf.io/resource_identifier" -) +// ResourceAnnotationKeyResourceIdentifier nominated the key to override the default name +// field in pod-resource-server (for qrm-related protocols); if the name field can't be +// guaranteed to be unique in some cases, we can relay on this annotation to get unique keys +// (to replace with the default name) +const ResourceAnnotationKeyResourceIdentifier = "katalyst.kubewharf.io/resource_identifier"