mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 03:51:43 +02:00
* Simplify state reconciliation and support changing Softnet settings * Remove unused "updateFunc" parameter from syncOnDiskVMs() * Don't take an address of a loop variable * ensure → ensures * updateVMState(): don't forget to update VMState * Introduce TestSpecUpdateSoftnet integration test * Update OpenAPI specification to include generation/observedGeneration
34 lines
901 B
Go
34 lines
901 B
Go
package controller
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/cirruslabs/orchard/internal/responder"
|
|
"github.com/cirruslabs/orchard/internal/version"
|
|
v1pkg "github.com/cirruslabs/orchard/pkg/resource/v1"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func (controller *Controller) controllerInfo(ctx *gin.Context) responder.Responder {
|
|
// Only require the service account to be valid,
|
|
// no roles are needed to query this endpoint
|
|
if responder := controller.authorize(ctx); responder != nil {
|
|
return responder
|
|
}
|
|
|
|
capabilities := []v1pkg.ControllerCapability{
|
|
v1pkg.ControllerCapabilityRPCV1,
|
|
v1pkg.ControllerCapabilityVMStateEndpoint,
|
|
}
|
|
|
|
if controller.experimentalRPCV2 {
|
|
capabilities = append(capabilities, v1pkg.ControllerCapabilityRPCV2)
|
|
}
|
|
|
|
return responder.JSON(http.StatusOK, &v1pkg.ControllerInfo{
|
|
Version: version.Version,
|
|
Commit: version.Commit,
|
|
Capabilities: capabilities,
|
|
})
|
|
}
|