mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
taints
This commit is contained in:
@@ -2,6 +2,7 @@ package taints
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/glueops/autoglue/internal/db"
|
||||
@@ -9,6 +10,19 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
var allowedEffects = map[string]struct{}{
|
||||
"NoSchedule": {},
|
||||
"PreferNoSchedule": {},
|
||||
"NoExecute": {},
|
||||
}
|
||||
|
||||
// includeNodePools returns true when the query param requests linked pools.
|
||||
// Accepts both "node_pools" and "node_groups" for compatibility.
|
||||
func includeNodePools(r *http.Request) bool {
|
||||
inc := strings.TrimSpace(r.URL.Query().Get("include"))
|
||||
return strings.EqualFold(inc, "node_pools") || strings.EqualFold(inc, "node_groups")
|
||||
}
|
||||
|
||||
func toResp(t models.Taint, include bool) taintResponse {
|
||||
resp := taintResponse{
|
||||
ID: t.ID,
|
||||
|
||||
Reference in New Issue
Block a user