diff --git a/kardinal-manager/gomod2nix.toml b/kardinal-manager/gomod2nix.toml index ff526bf7..990f7cd9 100644 --- a/kardinal-manager/gomod2nix.toml +++ b/kardinal-manager/gomod2nix.toml @@ -52,6 +52,9 @@ schema = 3 [mod."github.com/bmatcuk/doublestar"] version = "v1.1.1" hash = "sha256-mcR+gZ11pja98RwW7eN6T6TwC07ujPmQ8CcyH45r//0=" + [mod."github.com/bmizerany/assert"] + version = "v0.0.0-20160611221934-b7ed37b82869" + hash = "sha256-WnAmAW0f97kZoGhBmIGNBjblTh02O9WfPrH9RD0PHqI=" [mod."github.com/bsm/ginkgo/v2"] version = "v2.12.0" hash = "sha256-rZ9AF2RPWwQcgFmh3bmUXDaTLL14fQfPtv+DuC8xqzQ=" diff --git a/libs/cli-kontrol-api/api/golang/client/client.gen.go b/libs/cli-kontrol-api/api/golang/client/client.gen.go index 4648baf5..a8102b72 100644 --- a/libs/cli-kontrol-api/api/golang/client/client.gen.go +++ b/libs/cli-kontrol-api/api/golang/client/client.gen.go @@ -13,6 +13,8 @@ import ( "net/url" "strings" + "gopkg.in/yaml.v2" + . "github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api/api/golang/types" "github.com/oapi-codegen/runtime" ) @@ -109,6 +111,9 @@ type ClientInterface interface { // GetTenantUuidFlows request GetTenantUuidFlows(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetTenantUuidManifest request + GetTenantUuidManifest(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetTenantUuidTemplates request GetTenantUuidTemplates(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -208,6 +213,18 @@ func (c *Client) GetTenantUuidFlows(ctx context.Context, uuid Uuid, reqEditors . return c.Client.Do(req) } +func (c *Client) GetTenantUuidManifest(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetTenantUuidManifestRequest(c.Server, uuid) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetTenantUuidTemplates(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTenantUuidTemplatesRequest(c.Server, uuid) if err != nil { @@ -464,6 +481,40 @@ func NewGetTenantUuidFlowsRequest(server string, uuid Uuid) (*http.Request, erro return req, nil } +// NewGetTenantUuidManifestRequest generates requests for GetTenantUuidManifest +func NewGetTenantUuidManifestRequest(server string, uuid Uuid) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "uuid", runtime.ParamLocationPath, uuid) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tenant/%s/manifest", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewGetTenantUuidTemplatesRequest generates requests for GetTenantUuidTemplates func NewGetTenantUuidTemplatesRequest(server string, uuid Uuid) (*http.Request, error) { var err error @@ -682,6 +733,9 @@ type ClientWithResponsesInterface interface { // GetTenantUuidFlowsWithResponse request GetTenantUuidFlowsWithResponse(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*GetTenantUuidFlowsResponse, error) + // GetTenantUuidManifestWithResponse request + GetTenantUuidManifestWithResponse(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*GetTenantUuidManifestResponse, error) + // GetTenantUuidTemplatesWithResponse request GetTenantUuidTemplatesWithResponse(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*GetTenantUuidTemplatesResponse, error) @@ -814,6 +868,30 @@ func (r GetTenantUuidFlowsResponse) StatusCode() int { return 0 } +type GetTenantUuidManifestResponse struct { + Body []byte + HTTPResponse *http.Response + YAML200 *string + JSON404 *NotFound + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetTenantUuidManifestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetTenantUuidManifestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetTenantUuidTemplatesResponse struct { Body []byte HTTPResponse *http.Response @@ -970,6 +1048,15 @@ func (c *ClientWithResponses) GetTenantUuidFlowsWithResponse(ctx context.Context return ParseGetTenantUuidFlowsResponse(rsp) } +// GetTenantUuidManifestWithResponse request returning *GetTenantUuidManifestResponse +func (c *ClientWithResponses) GetTenantUuidManifestWithResponse(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*GetTenantUuidManifestResponse, error) { + rsp, err := c.GetTenantUuidManifest(ctx, uuid, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetTenantUuidManifestResponse(rsp) +} + // GetTenantUuidTemplatesWithResponse request returning *GetTenantUuidTemplatesResponse func (c *ClientWithResponses) GetTenantUuidTemplatesWithResponse(ctx context.Context, uuid Uuid, reqEditors ...RequestEditorFn) (*GetTenantUuidTemplatesResponse, error) { rsp, err := c.GetTenantUuidTemplates(ctx, uuid, reqEditors...) @@ -1193,6 +1280,46 @@ func ParseGetTenantUuidFlowsResponse(rsp *http.Response) (*GetTenantUuidFlowsRes return response, nil } +// ParseGetTenantUuidManifestResponse parses an HTTP response from a GetTenantUuidManifestWithResponse call +func ParseGetTenantUuidManifestResponse(rsp *http.Response) (*GetTenantUuidManifestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetTenantUuidManifestResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest NotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "yaml") && rsp.StatusCode == 200: + var dest string + if err := yaml.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.YAML200 = &dest + + } + + return response, nil +} + // ParseGetTenantUuidTemplatesResponse parses an HTTP response from a GetTenantUuidTemplatesWithResponse call func ParseGetTenantUuidTemplatesResponse(rsp *http.Response) (*GetTenantUuidTemplatesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/libs/cli-kontrol-api/api/golang/server/server.gen.go b/libs/cli-kontrol-api/api/golang/server/server.gen.go index 9f0d546f..941f3d60 100644 --- a/libs/cli-kontrol-api/api/golang/server/server.gen.go +++ b/libs/cli-kontrol-api/api/golang/server/server.gen.go @@ -10,6 +10,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "io" "net/http" "net/url" "path" @@ -39,6 +40,9 @@ type ServerInterface interface { // (GET /tenant/{uuid}/flows) GetTenantUuidFlows(ctx echo.Context, uuid Uuid) error + // Cluster resource definition in a manifest YAML response + // (GET /tenant/{uuid}/manifest) + GetTenantUuidManifest(ctx echo.Context, uuid Uuid) error // (GET /tenant/{uuid}/templates) GetTenantUuidTemplates(ctx echo.Context, uuid Uuid) error @@ -139,6 +143,22 @@ func (w *ServerInterfaceWrapper) GetTenantUuidFlows(ctx echo.Context) error { return err } +// GetTenantUuidManifest converts echo context to params. +func (w *ServerInterfaceWrapper) GetTenantUuidManifest(ctx echo.Context) error { + var err error + // ------------- Path parameter "uuid" ------------- + var uuid Uuid + + err = runtime.BindStyledParameterWithOptions("simple", "uuid", ctx.Param("uuid"), &uuid, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter uuid: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetTenantUuidManifest(ctx, uuid) + return err +} + // GetTenantUuidTemplates converts echo context to params. func (w *ServerInterfaceWrapper) GetTenantUuidTemplates(ctx echo.Context) error { var err error @@ -244,6 +264,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.POST(baseURL+"/tenant/:uuid/flow/create", wrapper.PostTenantUuidFlowCreate) router.DELETE(baseURL+"/tenant/:uuid/flow/:flow-id", wrapper.DeleteTenantUuidFlowFlowId) router.GET(baseURL+"/tenant/:uuid/flows", wrapper.GetTenantUuidFlows) + router.GET(baseURL+"/tenant/:uuid/manifest", wrapper.GetTenantUuidManifest) router.GET(baseURL+"/tenant/:uuid/templates", wrapper.GetTenantUuidTemplates) router.POST(baseURL+"/tenant/:uuid/templates/create", wrapper.PostTenantUuidTemplatesCreate) router.DELETE(baseURL+"/tenant/:uuid/templates/:template-name", wrapper.DeleteTenantUuidTemplatesTemplateName) @@ -426,6 +447,51 @@ func (response GetTenantUuidFlows500JSONResponse) VisitGetTenantUuidFlowsRespons return json.NewEncoder(w).Encode(response) } +type GetTenantUuidManifestRequestObject struct { + Uuid Uuid `json:"uuid"` +} + +type GetTenantUuidManifestResponseObject interface { + VisitGetTenantUuidManifestResponse(w http.ResponseWriter) error +} + +type GetTenantUuidManifest200ApplicationxYamlResponse struct { + Body io.Reader + ContentLength int64 +} + +func (response GetTenantUuidManifest200ApplicationxYamlResponse) VisitGetTenantUuidManifestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/x-yaml") + if response.ContentLength != 0 { + w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) + } + w.WriteHeader(200) + + if closer, ok := response.Body.(io.ReadCloser); ok { + defer closer.Close() + } + _, err := io.Copy(w, response.Body) + return err +} + +type GetTenantUuidManifest404JSONResponse struct{ NotFoundJSONResponse } + +func (response GetTenantUuidManifest404JSONResponse) VisitGetTenantUuidManifestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type GetTenantUuidManifest500JSONResponse struct{ ErrorJSONResponse } + +func (response GetTenantUuidManifest500JSONResponse) VisitGetTenantUuidManifestResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + type GetTenantUuidTemplatesRequestObject struct { Uuid Uuid `json:"uuid"` } @@ -585,6 +651,9 @@ type StrictServerInterface interface { // (GET /tenant/{uuid}/flows) GetTenantUuidFlows(ctx context.Context, request GetTenantUuidFlowsRequestObject) (GetTenantUuidFlowsResponseObject, error) + // Cluster resource definition in a manifest YAML response + // (GET /tenant/{uuid}/manifest) + GetTenantUuidManifest(ctx context.Context, request GetTenantUuidManifestRequestObject) (GetTenantUuidManifestResponseObject, error) // (GET /tenant/{uuid}/templates) GetTenantUuidTemplates(ctx context.Context, request GetTenantUuidTemplatesRequestObject) (GetTenantUuidTemplatesResponseObject, error) @@ -747,6 +816,31 @@ func (sh *strictHandler) GetTenantUuidFlows(ctx echo.Context, uuid Uuid) error { return nil } +// GetTenantUuidManifest operation middleware +func (sh *strictHandler) GetTenantUuidManifest(ctx echo.Context, uuid Uuid) error { + var request GetTenantUuidManifestRequestObject + + request.Uuid = uuid + + handler := func(ctx echo.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetTenantUuidManifest(ctx.Request().Context(), request.(GetTenantUuidManifestRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetTenantUuidManifest") + } + + response, err := handler(ctx, request) + + if err != nil { + return err + } else if validResponse, ok := response.(GetTenantUuidManifestResponseObject); ok { + return validResponse.VisitGetTenantUuidManifestResponse(ctx.Response()) + } else if response != nil { + return fmt.Errorf("unexpected response type: %T", response) + } + return nil +} + // GetTenantUuidTemplates operation middleware func (sh *strictHandler) GetTenantUuidTemplates(ctx echo.Context, uuid Uuid) error { var request GetTenantUuidTemplatesRequestObject @@ -857,30 +951,33 @@ func (sh *strictHandler) GetTenantUuidTopology(ctx echo.Context, uuid Uuid) erro // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8xZW2/bNhT+KwS3R9lKtg4Y/LYl7WasK4IleSqKgpWOZTYSyZKUEyPQfx940Z2y5QZt", - "/RBAEc/98h0e6xknvBCcAdMKr56xIJIUoEHa/zY5f1zQ1DymoBJJhaac4RV+k/NHRFNgmm4oSBxhal4L", - "orc4wowUgFcNd4QlfCmphBSvtCwhwirZQkGMWL0XhlRpSVmGqyrCGgqREw0LJ2Wo2bxFfIP0FlBNGlbf", - "F3SaEWUZ8vr+fn1d65ageCmTCd2W/xSVlSFWgjMFNvKvpeTSPCScaWDaPBIhcpoQY0z8WRmLnjsSheQC", - "pKaOH2r+vgdWLLLKo6ENES5UNsVSgFIkC3BVXS/fe70fGjL+6TMk2jkYkGu0vuP6DS9Z+gJvQ8n6zycI", - "ra9Dvtb5W7iTSe5wrAZe94VFxp45IWiUMK7RxsbAEDkvrWNXeak0yDsueM6zfSDPaeZDoKGwDz9L2OAV", - "/iluGzv2EuPXaQbGeW8ZkZLszf+MpydIecfTgJRBSJzIyBs4jkaErTEjh3LyCfJxPt6a12hjincLyAhd", - "hrLqe3LEfreFDlzVPdxEP20gZVKyJjIDPVeyo54jeRC2BlS8vlDgDPiOA9fB6pHx9qyUeT/HYx8PJbRF", - "81balHW3ApKeqkG7FiSDRc4Toh1IwRMpRG7kfCLJA7B0QVYGupUOJhnkjibtgBhz1xTkaLz7pgxkh9wb", - "ts6aZRKUuuJsQ7OAq+7YPD4tMu7RBjPQj1w+UJbtLpdeBI5akgUtBJe23PxE6XLgyI2bFX74XS0pj4mg", - "cUsQ7y7ridJx1CsJ+fQvocwjzRE/Fok9n48V/fCEoIcUoARxTTuZ6lPV3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/b21l9wWVktrxH0zebvAAAA///Qvf/b", + "fSAAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/libs/cli-kontrol-api/api/typescript/client/types.d.ts b/libs/cli-kontrol-api/api/typescript/client/types.d.ts index 4a149529..3cc0e3e0 100644 --- a/libs/cli-kontrol-api/api/typescript/client/types.d.ts +++ b/libs/cli-kontrol-api/api/typescript/client/types.d.ts @@ -188,6 +188,29 @@ export interface paths { }; }; }; + "/tenant/{uuid}/manifest": { + /** + * Cluster resource definition in a manifest YAML response + * @description This endpoint returns all the Kubernetes resource for the cluster topology in one multi-resource manifest response + */ + get: { + parameters: { + path: { + uuid: components["parameters"]["uuid"]; + }; + }; + responses: { + /** @description Successful response */ + 200: { + content: { + "application/x-yaml": string; + }; + }; + 404: components["responses"]["NotFound"]; + 500: components["responses"]["Error"]; + }; + }; + }; } export type webhooks = Record; diff --git a/libs/cli-kontrol-api/go.mod b/libs/cli-kontrol-api/go.mod index 2e18a108..7552e9fb 100644 --- a/libs/cli-kontrol-api/go.mod +++ b/libs/cli-kontrol-api/go.mod @@ -8,6 +8,7 @@ require ( github.com/getkin/kin-openapi v0.124.0 github.com/labstack/echo/v4 v4.12.0 github.com/oapi-codegen/runtime v1.1.1 + gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.30.2 ) @@ -38,7 +39,6 @@ require ( golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.30.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect diff --git a/libs/cli-kontrol-api/gomod2nix.toml b/libs/cli-kontrol-api/gomod2nix.toml index ff526bf7..990f7cd9 100644 --- a/libs/cli-kontrol-api/gomod2nix.toml +++ b/libs/cli-kontrol-api/gomod2nix.toml @@ -52,6 +52,9 @@ schema = 3 [mod."github.com/bmatcuk/doublestar"] version = "v1.1.1" hash = "sha256-mcR+gZ11pja98RwW7eN6T6TwC07ujPmQ8CcyH45r//0=" + [mod."github.com/bmizerany/assert"] + version = "v0.0.0-20160611221934-b7ed37b82869" + hash = "sha256-WnAmAW0f97kZoGhBmIGNBjblTh02O9WfPrH9RD0PHqI=" [mod."github.com/bsm/ginkgo/v2"] version = "v2.12.0" hash = "sha256-rZ9AF2RPWwQcgFmh3bmUXDaTLL14fQfPtv+DuC8xqzQ=" diff --git a/libs/cli-kontrol-api/specs/api.yaml b/libs/cli-kontrol-api/specs/api.yaml index 6c66e256..296ac8f7 100644 --- a/libs/cli-kontrol-api/specs/api.yaml +++ b/libs/cli-kontrol-api/specs/api.yaml @@ -170,6 +170,27 @@ paths: "2xx": description: Template deletion status + /tenant/{uuid}/manifest: + get: + tags: + - tenant + - manifest + summary: Cluster resource definition in a manifest YAML response + description: This endpoint returns all the Kubernetes resource for the cluster topology in one multi-resource manifest response + parameters: + - $ref: "#/components/parameters/uuid" + responses: + '500': + $ref: "#/components/responses/Error" + '404': + $ref: "#/components/responses/NotFound" + '200': + description: Successful response + content: + application/x-yaml: + schema: + type: string + components: responses: Error: diff --git a/libs/manager-kontrol-api/gomod2nix.toml b/libs/manager-kontrol-api/gomod2nix.toml index ff526bf7..990f7cd9 100644 --- a/libs/manager-kontrol-api/gomod2nix.toml +++ b/libs/manager-kontrol-api/gomod2nix.toml @@ -52,6 +52,9 @@ schema = 3 [mod."github.com/bmatcuk/doublestar"] version = "v1.1.1" hash = "sha256-mcR+gZ11pja98RwW7eN6T6TwC07ujPmQ8CcyH45r//0=" + [mod."github.com/bmizerany/assert"] + version = "v0.0.0-20160611221934-b7ed37b82869" + hash = "sha256-WnAmAW0f97kZoGhBmIGNBjblTh02O9WfPrH9RD0PHqI=" [mod."github.com/bsm/ginkgo/v2"] version = "v2.12.0" hash = "sha256-rZ9AF2RPWwQcgFmh3bmUXDaTLL14fQfPtv+DuC8xqzQ=" diff --git a/libs/manager-kontrol-api/specs/api.yaml b/libs/manager-kontrol-api/specs/api.yaml index 9512c5d4..409a4a44 100644 --- a/libs/manager-kontrol-api/specs/api.yaml +++ b/libs/manager-kontrol-api/specs/api.yaml @@ -13,7 +13,7 @@ paths: responses: default: $ref: "#/components/responses/NotOk" - "200": + '200': description: Successful response content: application/json: