mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-04-17 19:49:23 +02:00
* feat: add cluster metadata key-value store
- Add ClusterMetadata model with ClusterID FK, key, value fields
- Add Metadata []ClusterMetadata relation to Cluster model
- Add CRUD handlers: List, Get, Create, Update, Delete cluster metadata
- Keys are forced to lowercase on create/update
- Values preserve case sensitivity
- Add metadata routes under /clusters/{clusterID}/metadata
- Include metadata in ClusterResponse DTO and clusterToDTO mapping
- Add Preload(Metadata) to all cluster queries
- Register ClusterMetadata in AutoMigrate
Closes: internal-GlueOps/issues#302
* feat: include cluster metadata in prepare payload
- Preload cluster Metadata in ClusterPrepareWorker
- Map cluster metadata into mapper.ClusterToDTO response payload
This ensures metadata key-value pairs are injected into the platform JSON payload used by prepare/bootstrap flows.
* feat: add cluster metadata UI section to configure dialog
* feat: simplify cluster metadata to map[string]string in response
* fix: address cluster metadata PR review feedback
Agent-Logs-Url: https://github.com/GlueOps/autoglue/sessions/f767d4b8-ecae-4cde-bb5c-f0845c5a7cdf
Co-authored-by: yesterdaysrebel <256862558+yesterdaysrebel@users.noreply.github.com>
* chore: finalize review feedback updates
Agent-Logs-Url: https://github.com/GlueOps/autoglue/sessions/f767d4b8-ecae-4cde-bb5c-f0845c5a7cdf
Co-authored-by: yesterdaysrebel <256862558+yesterdaysrebel@users.noreply.github.com>
* chore: revert unintended go.sum change
Agent-Logs-Url: https://github.com/GlueOps/autoglue/sessions/f767d4b8-ecae-4cde-bb5c-f0845c5a7cdf
Co-authored-by: yesterdaysrebel <256862558+yesterdaysrebel@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yesterdaysrebel <256862558+yesterdaysrebel@users.noreply.github.com>
54 lines
2.4 KiB
Go
54 lines
2.4 KiB
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/glueops/autoglue/internal/bg"
|
|
"github.com/glueops/autoglue/internal/config"
|
|
"github.com/glueops/autoglue/internal/handlers"
|
|
"github.com/go-chi/chi/v5"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func mountClusterRoutes(r chi.Router, db *gorm.DB, cfg config.Config, jobs *bg.Jobs, authOrg func(http.Handler) http.Handler) {
|
|
r.Route("/clusters", func(c chi.Router) {
|
|
c.Use(authOrg)
|
|
c.Get("/", handlers.ListClusters(db, cfg))
|
|
c.Post("/", handlers.CreateCluster(db, cfg))
|
|
|
|
c.Get("/{clusterID}", handlers.GetCluster(db, cfg))
|
|
c.Patch("/{clusterID}", handlers.UpdateCluster(db, cfg))
|
|
c.Delete("/{clusterID}", handlers.DeleteCluster(db))
|
|
|
|
c.Post("/{clusterID}/captain-domain", handlers.AttachCaptainDomain(db, cfg))
|
|
c.Delete("/{clusterID}/captain-domain", handlers.DetachCaptainDomain(db, cfg))
|
|
|
|
c.Post("/{clusterID}/control-plane-record-set", handlers.AttachControlPlaneRecordSet(db, cfg))
|
|
c.Delete("/{clusterID}/control-plane-record-set", handlers.DetachControlPlaneRecordSet(db, cfg))
|
|
|
|
c.Post("/{clusterID}/apps-load-balancer", handlers.AttachAppsLoadBalancer(db, cfg))
|
|
c.Delete("/{clusterID}/apps-load-balancer", handlers.DetachAppsLoadBalancer(db, cfg))
|
|
c.Post("/{clusterID}/glueops-load-balancer", handlers.AttachGlueOpsLoadBalancer(db, cfg))
|
|
c.Delete("/{clusterID}/glueops-load-balancer", handlers.DetachGlueOpsLoadBalancer(db, cfg))
|
|
|
|
c.Post("/{clusterID}/bastion", handlers.AttachBastionServer(db, cfg))
|
|
c.Delete("/{clusterID}/bastion", handlers.DetachBastionServer(db, cfg))
|
|
|
|
c.Post("/{clusterID}/kubeconfig", handlers.SetClusterKubeconfig(db, cfg))
|
|
c.Delete("/{clusterID}/kubeconfig", handlers.ClearClusterKubeconfig(db, cfg))
|
|
|
|
c.Post("/{clusterID}/node-pools", handlers.AttachNodePool(db, cfg))
|
|
c.Delete("/{clusterID}/node-pools/{nodePoolID}", handlers.DetachNodePool(db, cfg))
|
|
|
|
c.Get("/{clusterID}/metadata", handlers.ListClusterMetadata(db))
|
|
c.Post("/{clusterID}/metadata", handlers.CreateClusterMetadata(db))
|
|
c.Get("/{clusterID}/metadata/{metadataID}", handlers.GetClusterMetadata(db))
|
|
c.Patch("/{clusterID}/metadata/{metadataID}", handlers.UpdateClusterMetadata(db))
|
|
c.Delete("/{clusterID}/metadata/{metadataID}", handlers.DeleteClusterMetadata(db))
|
|
|
|
c.Get("/{clusterID}/runs", handlers.ListClusterRuns(db))
|
|
c.Get("/{clusterID}/runs/{runID}", handlers.GetClusterRun(db))
|
|
c.Post("/{clusterID}/actions/{actionID}/runs", handlers.RunClusterAction(db, jobs))
|
|
})
|
|
}
|