From 9cd4b3c1cc79f3cde124f48a61aafcbbd0101349 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 5 Jun 2025 16:20:48 +0200 Subject: [PATCH] Convert to all lower case --- internal/api/node.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/node.go b/internal/api/node.go index 62c1e2a..7a582ed 100644 --- a/internal/api/node.go +++ b/internal/api/node.go @@ -7,6 +7,7 @@ package api import ( "fmt" "net/http" + "strings" "github.com/ClusterCockpit/cc-backend/internal/repository" "github.com/ClusterCockpit/cc-backend/pkg/schema" @@ -26,7 +27,7 @@ type UpdateNodeStatesRequest struct { // this routine assumes that only one of them applies per node func determineState(states []string) schema.NodeState { for _, state := range states { - switch state { + switch strings.ToLower(state) { case "allocated": return schema.NodeStateAllocated case "reserved":