mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-01 11:13:50 +02:00
Convert to all lower case
This commit is contained in:
parent
1d9aa75960
commit
9cd4b3c1cc
@ -7,6 +7,7 @@ package api
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/ClusterCockpit/cc-backend/internal/repository"
|
"github.com/ClusterCockpit/cc-backend/internal/repository"
|
||||||
"github.com/ClusterCockpit/cc-backend/pkg/schema"
|
"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
|
// this routine assumes that only one of them applies per node
|
||||||
func determineState(states []string) schema.NodeState {
|
func determineState(states []string) schema.NodeState {
|
||||||
for _, state := range states {
|
for _, state := range states {
|
||||||
switch state {
|
switch strings.ToLower(state) {
|
||||||
case "allocated":
|
case "allocated":
|
||||||
return schema.NodeStateAllocated
|
return schema.NodeStateAllocated
|
||||||
case "reserved":
|
case "reserved":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user