Skip to main content
Glama
storage_class.go1.12 kB
package service import ( "fmt" "github.com/weibaohui/kom/utils" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/klog/v2" ) type storageClassService struct { } // SetPVCCount 设置 PVC 数量 func (n *storageClassService) SetPVCCount(selectedCluster string, item *unstructured.Unstructured) *unstructured.Unstructured { name := item.GetName() // 从PVCService中获取PVC数量 count := PVCService().GetPVCCount(selectedCluster, name) klog.V(6).Infof("SetPVCCount: %s/%s, count: %d", selectedCluster, name, count) utils.AddOrUpdateAnnotations(item, map[string]string{ "pvc.count": fmt.Sprintf("%d", count), }) return item } // SetPVCount 设置 PV 数量 func (n *storageClassService) SetPVCount(selectedCluster string, item *unstructured.Unstructured) *unstructured.Unstructured { name := item.GetName() // 从PVService中获取PV数量 count := PVService().GetPVCount(selectedCluster, name) klog.V(6).Infof("SetPVCount: %s/%s, count: %d", selectedCluster, name, count) utils.AddOrUpdateAnnotations(item, map[string]string{ "pv.count": fmt.Sprintf("%d", count), }) return item }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/weibaohui/k8m'

If you have feedback or need assistance with the MCP directory API, please join our Discord server