fix: scale replicas in response, K8s metrics client, quota precheck, auth tests
- Add GetMetrics method to MetricsClient interface and implement cluster metrics API - Add QuotaPrecheck service for validating resource quotas before deployment - Add auth DTO with role/permission models and auth handler tests - Add instance diagnostics: mounted NFS volumes, labels, annotations in pod diagnostics - Update workspace handler with GetWorkspace endpoint and shared-user list - Fix monitoring handler to use correct service method name - Add tail_lines fallback in instance handler for snake_case query params - Update nginx config for SSE log streaming support (no buffering) - Add comprehensive test coverage: auth_service_test, auth_handler_test, auth_dto_test, metrics_client_test, quota_precheck_test - Update error messages for quota validation and instance operations - ModifyModal: fix YAML lineWidth:0, modified keys summary, delta-only submit - InstanceCard: correctly disable scale-minus when replicas <= 0 - SidebarLayout: add hover transition for sidebar items - Update todo.md and lessons.md with latest fixes
This commit is contained in:
@ -3,8 +3,21 @@ package repository
|
||||
import (
|
||||
"context"
|
||||
"github.com/ocdp/cluster-service/internal/domain/entity"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
type ResourceVector struct {
|
||||
CPU resource.Quantity
|
||||
Memory resource.Quantity
|
||||
GPU int64
|
||||
GPUMemoryMB int64
|
||||
}
|
||||
|
||||
type ResourceEstimate struct {
|
||||
Requests ResourceVector
|
||||
Limits ResourceVector
|
||||
}
|
||||
|
||||
// HelmClient Helm 客户端接口(Output Port)
|
||||
type HelmClient interface {
|
||||
// Install 安装 Helm Chart
|
||||
@ -33,4 +46,7 @@ type HelmClient interface {
|
||||
|
||||
// GetChartDefaultValues 从 chart 包中读取默认 values
|
||||
GetChartDefaultValues(chartPath string) (map[string]interface{}, error)
|
||||
|
||||
// EstimateInstanceResources renders an instance chart with final values and sums Pod template resources.
|
||||
EstimateInstanceResources(ctx context.Context, cluster *entity.Cluster, instance *entity.Instance) (*ResourceEstimate, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user