Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions api/internal/api/stubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,9 @@ func (h *Handler) GetMetrics(c *gin.Context) {
ctx := c.Request.Context()

// Initialize default values
var err error
var nodes *corev1.NodeList
var pods *corev1.PodList
totalNodes := 0
readyNodes := 0
totalCPU := int64(0)
Expand All @@ -685,7 +688,7 @@ func (h *Handler) GetMetrics(c *gin.Context) {

// Get cluster nodes (handle nil k8sClient gracefully)
if h.k8sClient != nil {
nodes, err := h.k8sClient.GetNodes(ctx)
nodes, err = h.k8sClient.GetNodes(ctx)
if err != nil {
log.Printf("Failed to get cluster nodes: %v", err)
// Continue with default values instead of failing
Expand Down Expand Up @@ -715,7 +718,7 @@ func (h *Handler) GetMetrics(c *gin.Context) {
}

// Get all pods to calculate resource usage
pods, err := h.k8sClient.GetPods(ctx, h.namespace)
pods, err = h.k8sClient.GetPods(ctx, h.namespace)
if err == nil {
usedPods = len(pods.Items)
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/admin/UserDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export default function UserDetail() {
</Box>
<Divider sx={{ mb: 2 }} />

{userGroups && userGroups.groups.length > 0 ? (
{userGroups?.groups && userGroups.groups.length > 0 ? (
<TableContainer component={Paper} variant="outlined">
<Table size="small">
<TableHead>
Expand Down
Loading