This commit is contained in:
allanice001
2025-09-03 22:49:28 +01:00
parent 816e11dbd4
commit 4e254fc569
9 changed files with 1115 additions and 193 deletions

View File

@@ -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,