feat: adding taints, labels and annotations to terraform provider and ui all implementing the SDK

This commit is contained in:
allanice001
2025-11-05 21:31:13 +00:00
parent c41af60b26
commit b09c3179c7
46 changed files with 1021 additions and 271 deletions

View File

@@ -19,14 +19,14 @@ import (
// ListAnnotations godoc
// @ID ListAnnotations
// @Summary List annotations (org scoped)
// @Description Returns annotations for the organization in X-Org-ID. Filters: `name`, `value`, and `q` (name contains). Add `include=node_pools` to include linked node pools.
// @Description Returns annotations for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.
// @Tags Annotations
// @Accept json
// @Produce json
// @Param X-Org-ID header string false "Organization UUID"
// @Param name query string false "Exact name"
// @Param key query string false "Exact key"
// @Param value query string false "Exact value"
// @Param q query string false "name contains (case-insensitive)"
// @Param q query string false "key contains (case-insensitive)"
// @Success 200 {array} dto.AnnotationResponse
// @Failure 401 {string} string "Unauthorized"
// @Failure 403 {string} string "organization required"
@@ -60,6 +60,10 @@ func ListAnnotations(db *gorm.DB) http.HandlerFunc {
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
return
}
if out == nil {
out = []dto.AnnotationResponse{}
}
utils.WriteJSON(w, http.StatusOK, out)
}
}

View File

@@ -59,6 +59,9 @@ func ListLabels(db *gorm.DB) http.HandlerFunc {
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
return
}
if out == nil {
out = []dto.LabelResponse{}
}
utils.WriteJSON(w, http.StatusOK, out)
}