diff --git a/api/apiv1/design/cluster.go b/api/apiv1/design/cluster.go index 0bd4836f..6b593371 100644 --- a/api/apiv1/design/cluster.go +++ b/api/apiv1/design/cluster.go @@ -18,10 +18,6 @@ var Cluster = g.Type("Cluster", func() { g.Description("Unique identifier for the cluster.") g.Example("production") }) - g.Attribute("tenant_id", Identifier, func() { - g.Description("Unique identifier for the cluster's owner.") - g.Example("engineering") - }) g.Attribute("status", ClusterStatus, func() { g.Description("Current status of the cluster.") }) @@ -30,7 +26,7 @@ var Cluster = g.Type("Cluster", func() { g.Example(HostsArrayExample) }) - g.Required("id", "tenant_id", "status", "hosts") + g.Required("id", "status", "hosts") }) var InitClusterRequest = g.Type("InitClusterRequest", func() { diff --git a/api/apiv1/gen/control_plane/service.go b/api/apiv1/gen/control_plane/service.go index e5c2d640..a6383fc9 100644 --- a/api/apiv1/gen/control_plane/service.go +++ b/api/apiv1/gen/control_plane/service.go @@ -205,8 +205,6 @@ type CancelDatabaseTaskPayload struct { type Cluster struct { // Unique identifier for the cluster. ID Identifier - // Unique identifier for the cluster's owner. - TenantID Identifier // Current status of the cluster. Status *ClusterStatus // All of the hosts in the cluster. diff --git a/api/apiv1/gen/http/control_plane/client/types.go b/api/apiv1/gen/http/control_plane/client/types.go index 7643fa3f..41607c3a 100644 --- a/api/apiv1/gen/http/control_plane/client/types.go +++ b/api/apiv1/gen/http/control_plane/client/types.go @@ -132,8 +132,6 @@ type GetJoinOptionsResponseBody struct { type GetClusterResponseBody struct { // Unique identifier for the cluster. ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` - // Unique identifier for the cluster's owner. - TenantID *string `form:"tenant_id,omitempty" json:"tenant_id,omitempty" xml:"tenant_id,omitempty"` // Current status of the cluster. Status *ClusterStatusResponseBody `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"` // All of the hosts in the cluster. @@ -2708,8 +2706,7 @@ func NewGetJoinOptionsServerError(body *GetJoinOptionsServerErrorResponseBody) * // endpoint result from a HTTP "OK" response. func NewGetClusterClusterOK(body *GetClusterResponseBody) *controlplane.Cluster { v := &controlplane.Cluster{ - ID: controlplane.Identifier(*body.ID), - TenantID: controlplane.Identifier(*body.TenantID), + ID: controlplane.Identifier(*body.ID), } v.Status = unmarshalClusterStatusResponseBodyToControlplaneClusterStatus(body.Status) v.Hosts = make([]*controlplane.Host, len(body.Hosts)) @@ -4011,9 +4008,6 @@ func ValidateGetClusterResponseBody(body *GetClusterResponseBody) (err error) { if body.ID == nil { err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) } - if body.TenantID == nil { - err = goa.MergeErrors(err, goa.MissingFieldError("tenant_id", "body")) - } if body.Status == nil { err = goa.MergeErrors(err, goa.MissingFieldError("status", "body")) } @@ -4030,16 +4024,6 @@ func ValidateGetClusterResponseBody(body *GetClusterResponseBody) (err error) { err = goa.MergeErrors(err, goa.InvalidLengthError("body.id", *body.ID, utf8.RuneCountInString(*body.ID), 63, false)) } } - if body.TenantID != nil { - if utf8.RuneCountInString(*body.TenantID) < 1 { - err = goa.MergeErrors(err, goa.InvalidLengthError("body.tenant_id", *body.TenantID, utf8.RuneCountInString(*body.TenantID), 1, true)) - } - } - if body.TenantID != nil { - if utf8.RuneCountInString(*body.TenantID) > 63 { - err = goa.MergeErrors(err, goa.InvalidLengthError("body.tenant_id", *body.TenantID, utf8.RuneCountInString(*body.TenantID), 63, false)) - } - } if body.Status != nil { if err2 := ValidateClusterStatusResponseBody(body.Status); err2 != nil { err = goa.MergeErrors(err, err2) diff --git a/api/apiv1/gen/http/control_plane/server/types.go b/api/apiv1/gen/http/control_plane/server/types.go index bb70c8da..04832a5c 100644 --- a/api/apiv1/gen/http/control_plane/server/types.go +++ b/api/apiv1/gen/http/control_plane/server/types.go @@ -132,8 +132,6 @@ type GetJoinOptionsResponseBody struct { type GetClusterResponseBody struct { // Unique identifier for the cluster. ID string `form:"id" json:"id" xml:"id"` - // Unique identifier for the cluster's owner. - TenantID string `form:"tenant_id" json:"tenant_id" xml:"tenant_id"` // Current status of the cluster. Status *ClusterStatusResponseBody `form:"status" json:"status" xml:"status"` // All of the hosts in the cluster. @@ -2474,8 +2472,7 @@ func NewGetJoinOptionsResponseBody(res *controlplane.ClusterJoinOptions) *GetJoi // the "get-cluster" endpoint of the "control-plane" service. func NewGetClusterResponseBody(res *controlplane.Cluster) *GetClusterResponseBody { body := &GetClusterResponseBody{ - ID: string(res.ID), - TenantID: string(res.TenantID), + ID: string(res.ID), } if res.Status != nil { body.Status = marshalControlplaneClusterStatusToClusterStatusResponseBody(res.Status) diff --git a/api/apiv1/gen/http/openapi.json b/api/apiv1/gen/http/openapi.json index 7471427e..af637e1b 100644 --- a/api/apiv1/gen/http/openapi.json +++ b/api/apiv1/gen/http/openapi.json @@ -32,7 +32,6 @@ "$ref": "#/definitions/Cluster", "required": [ "id", - "tenant_id", "status", "hosts" ] @@ -2439,13 +2438,6 @@ }, "status": { "$ref": "#/definitions/ClusterStatus" - }, - "tenant_id": { - "type": "string", - "description": "Unique identifier for the cluster's owner.", - "example": "engineering", - "minLength": 1, - "maxLength": 63 } }, "example": { @@ -2568,12 +2560,10 @@ "id": "production", "status": { "state": "available" - }, - "tenant_id": "engineering" + } }, "required": [ "id", - "tenant_id", "status", "hosts" ] diff --git a/api/apiv1/gen/http/openapi.yaml b/api/apiv1/gen/http/openapi.yaml index 1a319bd3..2a770f45 100644 --- a/api/apiv1/gen/http/openapi.yaml +++ b/api/apiv1/gen/http/openapi.yaml @@ -27,7 +27,6 @@ paths: $ref: '#/definitions/Cluster' required: - id - - tenant_id - status - hosts "409": @@ -1741,12 +1740,6 @@ definitions: maxLength: 63 status: $ref: '#/definitions/ClusterStatus' - tenant_id: - type: string - description: Unique identifier for the cluster's owner. - example: engineering - minLength: 1 - maxLength: 63 example: hosts: - cohort: @@ -1830,10 +1823,8 @@ definitions: id: production status: state: available - tenant_id: engineering required: - id - - tenant_id - status - hosts ClusterJoinToken: diff --git a/api/apiv1/gen/http/openapi3.json b/api/apiv1/gen/http/openapi3.json index 56dc3080..4b65609c 100644 --- a/api/apiv1/gen/http/openapi3.json +++ b/api/apiv1/gen/http/openapi3.json @@ -147,8 +147,7 @@ "id": "production", "status": { "state": "available" - }, - "tenant_id": "engineering" + } } } } @@ -4777,13 +4776,6 @@ }, "status": { "$ref": "#/components/schemas/ClusterStatus" - }, - "tenant_id": { - "type": "string", - "description": "A user-specified identifier. Must be 1-63 characters, contain only lower-cased letters and hyphens, start and end with a letter or number, and not contain consecutive hyphens.", - "example": "76f9b8c0-4958-11f0-a489-3bb29577c696", - "minLength": 1, - "maxLength": 63 } }, "example": { @@ -4906,12 +4898,10 @@ "id": "production", "status": { "state": "available" - }, - "tenant_id": "engineering" + } }, "required": [ "id", - "tenant_id", "status", "hosts" ] diff --git a/api/apiv1/gen/http/openapi3.yaml b/api/apiv1/gen/http/openapi3.yaml index af2b93dd..c5a85ff2 100644 --- a/api/apiv1/gen/http/openapi3.yaml +++ b/api/apiv1/gen/http/openapi3.yaml @@ -103,7 +103,6 @@ paths: id: production status: state: available - tenant_id: engineering "409": description: 'cluster_not_initialized: Conflict response.' content: @@ -3246,12 +3245,6 @@ components: maxLength: 63 status: $ref: '#/components/schemas/ClusterStatus' - tenant_id: - type: string - description: A user-specified identifier. Must be 1-63 characters, contain only lower-cased letters and hyphens, start and end with a letter or number, and not contain consecutive hyphens. - example: 76f9b8c0-4958-11f0-a489-3bb29577c696 - minLength: 1 - maxLength: 63 example: hosts: - cohort: @@ -3335,10 +3328,8 @@ components: id: production status: state: available - tenant_id: engineering required: - id - - tenant_id - status - hosts ClusterCredentials: diff --git a/changes/unreleased/Removed-20251222-093048.yaml b/changes/unreleased/Removed-20251222-093048.yaml new file mode 100644 index 00000000..5e740484 --- /dev/null +++ b/changes/unreleased/Removed-20251222-093048.yaml @@ -0,0 +1,3 @@ +kind: Removed +body: Removed unused "tenant_id" field from GetCluster endpoint. +time: 2025-12-22T09:30:48.776635-06:00 diff --git a/server/internal/api/apiv1/post_init_handlers.go b/server/internal/api/apiv1/post_init_handlers.go index 831d8294..c7a346a9 100644 --- a/server/internal/api/apiv1/post_init_handlers.go +++ b/server/internal/api/apiv1/post_init_handlers.go @@ -152,10 +152,9 @@ func (s *PostInitHandlers) GetCluster(ctx context.Context) (*api.Cluster, error) return nil, apiErr(err) } cluster := &api.Cluster{ - ID: api.Identifier(storedCluster.ID), - TenantID: api.Identifier(s.cfg.TenantID), - Hosts: apiHosts, - Status: &api.ClusterStatus{State: "available"}, + ID: api.Identifier(storedCluster.ID), + Hosts: apiHosts, + Status: &api.ClusterStatus{State: "available"}, } return cluster, nil