mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-08-24 02:52:59 +02:00
Convert to all lower case
This commit is contained in:
@@ -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":
|
||||||
|
Reference in New Issue
Block a user