From b0afe8df48c5c968e61e122ef400c51535447ae7 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Mon, 15 Dec 2025 19:01:44 +0100 Subject: [PATCH 1/7] Refactor NodePool models to include generation field --- models-core/nodepool/example_nodepool.tsp | 1 + models-gcp/nodepool/example_nodepool.tsp | 1 + models/clusters/model.tsp | 6 +++--- models/nodepools/model.tsp | 18 ++++++++++++------ schemas/core/openapi.yaml | 13 +++++++++++++ schemas/gcp/openapi.yaml | 13 +++++++++++++ schemas/gcp/swagger.yaml | 17 +++++++++++++++++ 7 files changed, 60 insertions(+), 9 deletions(-) diff --git a/models-core/nodepool/example_nodepool.tsp b/models-core/nodepool/example_nodepool.tsp index 2d08576..f7f175f 100644 --- a/models-core/nodepool/example_nodepool.tsp +++ b/models-core/nodepool/example_nodepool.tsp @@ -8,6 +8,7 @@ const exampleNodePool: NodePool = #{ name: "worker-pool-1", labels: #{ environment: "production", pooltype: "worker" }, spec: #{}, + generation: 1, created_time: "2021-01-01T00:00:00Z", updated_time: "2021-01-01T00:00:00Z", created_by: "user-123@example.com", diff --git a/models-gcp/nodepool/example_nodepool.tsp b/models-gcp/nodepool/example_nodepool.tsp index 3ca171e..05b633e 100644 --- a/models-gcp/nodepool/example_nodepool.tsp +++ b/models-gcp/nodepool/example_nodepool.tsp @@ -7,6 +7,7 @@ const exampleNodePool: NodePool = #{ href: "https://api.hyperfleet.com/v1/nodepools/nodepool-123", name: "worker-pool-1", labels: #{ environment: "production", pooltype: "worker" }, + generation: 1, spec: #{ platform: #{ type: "gcp", diff --git a/models/clusters/model.tsp b/models/clusters/model.tsp index b1edfdd..a4fa7f5 100644 --- a/models/clusters/model.tsp +++ b/models/clusters/model.tsp @@ -61,8 +61,9 @@ model ClusterStatus { } @example(exampleCluster) -model Cluster extends ClusterBase { -...APICreatedResource; +model Cluster extends ClusterBase { + ...APICreatedResource; + /** * Generation field is updated on customer updates, reflecting the version of the "intent" of the customer */ @@ -70,7 +71,6 @@ model Cluster extends ClusterBase { generation: int32; status: ClusterStatus; - } @example(exampleClusterCreateRequest) diff --git a/models/nodepools/model.tsp b/models/nodepools/model.tsp index 23fd494..28ea4e1 100644 --- a/models/nodepools/model.tsp +++ b/models/nodepools/model.tsp @@ -4,6 +4,7 @@ import "../../aliases.tsp"; model NodePoolBase { ...APIResource; + /** * NodePool name (unique in a cluster) */ @@ -54,21 +55,26 @@ model NodePoolStatus { } @example(exampleNodePool) -model NodePool extends NodePoolBase{ +model NodePool extends NodePoolBase { + ...APICreatedResource; - ...APICreatedResource; - owner_references: ObjectReference; + /** + * Generation field is updated on customer updates, reflecting the version of the "intent" of the customer + */ + @minValue(1) + generation: int32; - status: NodePoolStatus; + owner_references: ObjectReference; + status: NodePoolStatus; } @example(exampleNodePoolCreateRequest) model NodePoolCreateRequest { - ...NodePoolBase; + ...NodePoolBase; } model NodePoolCreateResponse { - ...NodePool + ...NodePool; } model NodePoolList extends List { diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 9ce2b57..44cc17f 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -904,6 +904,7 @@ components: - updated_time - created_by - updated_by + - generation - owner_references - status properties: @@ -919,6 +920,11 @@ components: updated_by: type: string format: email + generation: + type: integer + format: int32 + minimum: 1 + description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer owner_references: $ref: '#/components/schemas/ObjectReference' status: @@ -934,6 +940,7 @@ components: environment: production pooltype: worker spec: {} + generation: 1 created_time: '2021-01-01T00:00:00Z' updated_time: '2021-01-01T00:00:00Z' created_by: user-123@example.com @@ -1037,6 +1044,7 @@ components: - updated_time - created_by - updated_by + - generation - owner_references - status - name @@ -1054,6 +1062,11 @@ components: updated_by: type: string format: email + generation: + type: integer + format: int32 + minimum: 1 + description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer owner_references: $ref: '#/components/schemas/ObjectReference' status: diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 1dbda88..4d8be90 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -958,6 +958,7 @@ components: - updated_time - created_by - updated_by + - generation - owner_references - status properties: @@ -973,6 +974,11 @@ components: updated_by: type: string format: email + generation: + type: integer + format: int32 + minimum: 1 + description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer owner_references: $ref: '#/components/schemas/ObjectReference' status: @@ -987,6 +993,7 @@ components: labels: environment: production pooltype: worker + generation: 1 spec: platform: type: gcp @@ -1129,6 +1136,7 @@ components: - updated_time - created_by - updated_by + - generation - owner_references - status - name @@ -1146,6 +1154,11 @@ components: updated_by: type: string format: email + generation: + type: integer + format: int32 + minimum: 1 + description: Generation field is updated on customer updates, reflecting the version of the "intent" of the customer owner_references: $ref: '#/components/schemas/ObjectReference' status: diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index c0cd7c3..bcbdc10 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -1057,6 +1057,7 @@ definitions: example: created_by: user-123@example.com created_time: '2021-01-01T00:00:00Z' + generation: 1 href: 'https://api.hyperfleet.com/v1/nodepools/nodepool-123' id: nodepool-123 kind: NodePool @@ -1119,6 +1120,13 @@ definitions: created_time: format: date-time type: string + generation: + description: >- + Generation field is updated on customer updates, reflecting the + version of the "intent" of the customer + format: int32 + minimum: 1 + type: integer owner_references: $ref: '#/definitions/ObjectReference' status: @@ -1134,6 +1142,7 @@ definitions: - updated_time - created_by - updated_by + - generation - owner_references - status type: object @@ -1236,6 +1245,13 @@ definitions: created_time: format: date-time type: string + generation: + description: >- + Generation field is updated on customer updates, reflecting the + version of the "intent" of the customer + format: int32 + minimum: 1 + type: integer href: description: Resource URI type: string @@ -1278,6 +1294,7 @@ definitions: - updated_time - created_by - updated_by + - generation - owner_references - status - name From a566b91533cd64c420c7543a4fe5dd0318b0cbe8 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Tue, 16 Dec 2025 19:25:28 +0100 Subject: [PATCH 2/7] bump version to v1.0.1 --- main.tsp | 2 +- schemas/core/openapi.yaml | 2 +- schemas/gcp/openapi.yaml | 2 +- schemas/gcp/swagger.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.tsp b/main.tsp index 54d420d..5712de6 100644 --- a/main.tsp +++ b/main.tsp @@ -20,7 +20,7 @@ using OpenAPI; * */ @service(#{ title: "HyperFleet API" }) -@info(#{ version: "1.0.0", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} }) +@info(#{ version: "1.0.1", contact: #{ name: "HyperFleet Team" }, license: #{ name: "Apache 2.0" ,url: "https://www.apache.org/licenses/LICENSE-2.0"} }) @server("https://hyperfleet.redhat.com", "Production") @route("/api/hyperfleet/v1") namespace HyperFleet; diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 44cc17f..d4b6879 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.0 + version: 1.0.1 contact: name: HyperFleet Team license: diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 4d8be90..d7d19d9 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.0 + version: 1.0.1 contact: name: HyperFleet Team license: diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index bcbdc10..1e8c722 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -16,7 +16,7 @@ info: name: Apache 2.0 url: 'https://www.apache.org/licenses/LICENSE-2.0' title: HyperFleet API - version: 1.0.0 + version: 1.0.1 host: hyperfleet.redhat.com basePath: / schemes: From ad4242469637e89814257ed6fff6ecd0e808958e Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Tue, 16 Dec 2025 19:47:47 +0100 Subject: [PATCH 3/7] add search description --- models/common/model.tsp | 2 ++ schemas/core/openapi.yaml | 3 +++ schemas/gcp/openapi.yaml | 3 +++ schemas/gcp/swagger.yaml | 47 ++++++++++++++++++++++++++++++++++----- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/models/common/model.tsp b/models/common/model.tsp index c98fd1e..4772e60 100644 --- a/models/common/model.tsp +++ b/models/common/model.tsp @@ -96,6 +96,8 @@ enum OrderDirection { } model SearchParams { + /** Filter results using TSL (Tree Search Language) query syntax. + * Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, `labels.region='us-east'` */ @query search?: string; } diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index d4b6879..522a8af 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -399,6 +399,9 @@ components: name: search in: query required: false + description: |- + Filter results using TSL (Tree Search Language) query syntax. + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, `labels.region='us-east'` schema: type: string explode: false diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index d7d19d9..462146a 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -324,6 +324,9 @@ components: name: search in: query required: false + description: |- + Filter results using TSL (Tree Search Language) query syntax. + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, `labels.region='us-east'` schema: type: string explode: false diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 1e8c722..2790a98 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -51,7 +51,12 @@ paths: name: order required: false type: string - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -110,7 +115,12 @@ paths: produces: - application/json parameters: - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -165,7 +175,12 @@ paths: name: order required: false type: string - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -282,7 +297,12 @@ paths: name: order required: false type: string - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -334,7 +354,12 @@ paths: name: order required: false type: string - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -379,7 +404,12 @@ paths: name: order required: false type: string - - in: query + - description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` + in: query name: search required: false type: string @@ -1535,6 +1565,11 @@ x-components: required: false type: integer SearchParams: + description: >- + Filter results using TSL (Tree Search Language) query syntax. + + Examples: `status.phase='NotReady'`, `name in ('c1','c2')`, + `labels.region='us-east'` in: query name: search required: false From 48ad3d6e11490c1bc4469916a3b9f86db2fb51b2 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Wed, 17 Dec 2025 12:53:17 +0100 Subject: [PATCH 4/7] restore security tag to add bearer token --- schemas/core/openapi.yaml | 10 ++++++++++ schemas/gcp/openapi.yaml | 10 ++++++++++ schemas/gcp/swagger.yaml | 11 +++++++++++ services/clusters.tsp | 1 + 4 files changed, 32 insertions(+) diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 522a8af..11a56fe 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -40,6 +40,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] post: operationId: postCluster summary: Create cluster @@ -71,6 +73,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ClusterCreateRequest' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}: get: operationId: getClusterById @@ -97,6 +101,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools: get: operationId: getNodePoolsByClusterId @@ -1212,6 +1218,10 @@ components: - Ready - Failed description: Phase of a resource (Cluster or NodePool) + securitySchemes: + BearerAuth: + type: http + scheme: bearer servers: - url: https://hyperfleet.redhat.com description: Production diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 462146a..c50a419 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -40,6 +40,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] post: operationId: postCluster summary: Create cluster @@ -71,6 +73,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ClusterCreateRequest' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}: get: operationId: getClusterById @@ -97,6 +101,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools: get: operationId: getNodePoolsByClusterId @@ -1377,6 +1383,10 @@ components: - NoSchedule - PreferNoSchedule - NoExecute + securitySchemes: + BearerAuth: + type: http + scheme: bearer servers: - url: https://hyperfleet.redhat.com description: Production diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 2790a98..76d4143 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -71,6 +71,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] operationId: getClusters summary: List clusters post: @@ -97,6 +99,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] description: >- Create a new cluster resource. @@ -139,6 +143,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] operationId: getClusterById summary: Get cluster by ID '/api/hyperfleet/v1/clusters/{cluster_id}/nodepools': @@ -1533,6 +1539,11 @@ definitions: - key - effect type: object +securityDefinitions: + BearerAuth: + in: header + name: Authorization + type: apiKey tags: [] x-components: parameters: diff --git a/services/clusters.tsp b/services/clusters.tsp index feec581..0890b9e 100644 --- a/services/clusters.tsp +++ b/services/clusters.tsp @@ -12,6 +12,7 @@ using OpenAPI; namespace HyperFleet; //@tag("Clusters") @route("/clusters") +@useAuth(HyperFleet.BearerAuth) interface Clusters { @get @route("") From 6f0e4b039f56a2d0dd6a0d45f1dc6deed68b45c1 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Wed, 17 Dec 2025 12:58:11 +0100 Subject: [PATCH 5/7] Add security to all endpoints --- schemas/core/openapi.yaml | 12 ++++++++++++ schemas/gcp/openapi.yaml | 10 ++++++++++ schemas/gcp/swagger.yaml | 10 ++++++++++ services/nodepools.tsp | 1 + services/statuses-internal.tsp | 1 + services/statuses.tsp | 1 + 6 files changed, 35 insertions(+) diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 11a56fe..78f4670 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -135,6 +135,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] post: operationId: createNodePool summary: Create nodepool @@ -167,6 +169,8 @@ paths: application/json: schema: $ref: '#/components/schemas/NodePoolCreateRequest' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}: get: operationId: getNodePoolById @@ -200,6 +204,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}/statuses: post: operationId: postNodePoolStatuses @@ -313,6 +319,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdapterStatusCreateRequest' + security: + - BearerAuth: [] get: operationId: getClusterStatuses summary: List all adapter statuses for cluster @@ -340,6 +348,8 @@ paths: description: The server could not understand the request due to invalid syntax. '404': description: The server cannot find the requested resource. + security: + - BearerAuth: [] /api/hyperfleet/v1/nodepools: get: operationId: getNodePools @@ -366,6 +376,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] components: parameters: QueryParams.order: diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index c50a419..599ff34 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -135,6 +135,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] post: operationId: createNodePool summary: Create nodepool @@ -167,6 +169,8 @@ paths: application/json: schema: $ref: '#/components/schemas/NodePoolCreateRequest' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}: get: operationId: getNodePoolById @@ -200,6 +204,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] /api/hyperfleet/v1/clusters/{cluster_id}/nodepools/{nodepool_id}/statuses: get: operationId: getNodePoolsStatuses @@ -265,6 +271,8 @@ paths: description: The server could not understand the request due to invalid syntax. '404': description: The server cannot find the requested resource. + security: + - BearerAuth: [] /api/hyperfleet/v1/nodepools: get: operationId: getNodePools @@ -291,6 +299,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + security: + - BearerAuth: [] components: parameters: QueryParams.order: diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 76d4143..985b837 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -201,6 +201,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] description: Returns the list of all nodepools for a cluster operationId: getNodePoolsByClusterId summary: List all nodepools for cluster @@ -233,6 +235,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] description: Create a NodePool for a cluster operationId: createNodePool summary: Create nodepool @@ -262,6 +266,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] description: Returns specific nodepool operationId: getNodePoolById summary: Get nodepool by ID @@ -378,6 +384,8 @@ paths: description: The server could not understand the request due to invalid syntax. '404': description: The server cannot find the requested resource. + security: + - BearerAuth: [] description: Returns adapter status reports for this cluster operationId: getClusterStatuses summary: List all adapter statuses for cluster @@ -430,6 +438,8 @@ paths: description: An unexpected error response. schema: $ref: '#/definitions/Error' + security: + - BearerAuth: [] description: Returns the list of all nodepools operationId: getNodePools summary: List all nodepools for cluster diff --git a/services/nodepools.tsp b/services/nodepools.tsp index 89666c0..7a07312 100644 --- a/services/nodepools.tsp +++ b/services/nodepools.tsp @@ -11,6 +11,7 @@ using OpenAPI; namespace HyperFleet; //@tag("NodePools") +@useAuth(HyperFleet.BearerAuth) interface NodePools { /** * Returns the list of all nodepools diff --git a/services/statuses-internal.tsp b/services/statuses-internal.tsp index 1c35f6a..8a19862 100644 --- a/services/statuses-internal.tsp +++ b/services/statuses-internal.tsp @@ -11,6 +11,7 @@ using OpenAPI; namespace HyperFleet; @route("/clusters/{cluster_id}/statuses") +@useAuth(HyperFleet.BearerAuth) //@tag("Cluster statuses") interface ClusterStatusesInternal{ diff --git a/services/statuses.tsp b/services/statuses.tsp index 04f0fa3..1a5c597 100644 --- a/services/statuses.tsp +++ b/services/statuses.tsp @@ -11,6 +11,7 @@ using OpenAPI; namespace HyperFleet; @route("/clusters/{cluster_id}/statuses") +@useAuth(HyperFleet.BearerAuth) //@tag("Cluster statuses") interface ClusterStatuses{ /** From 114abb43f1e1a34cc59f1541876789e70e1fc3b2 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Wed, 17 Dec 2025 13:19:44 +0100 Subject: [PATCH 6/7] add rules fro name fields --- models/clusters/model.tsp | 4 ++-- models/nodepools/model.tsp | 3 +++ schemas/core/openapi.yaml | 13 +++++++++++-- schemas/gcp/openapi.yaml | 13 +++++++++++-- schemas/gcp/swagger.yaml | 13 +++++++++++-- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/models/clusters/model.tsp b/models/clusters/model.tsp index a4fa7f5..aaeaaa9 100644 --- a/models/clusters/model.tsp +++ b/models/clusters/model.tsp @@ -8,9 +8,9 @@ model ClusterBase extends APIResource { /** * Cluster name (unique) */ - @minLength(1) + @minLength(3) @maxLength(63) - @pattern("^[a-z0-9-]+$") + @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") name: string; /** Cluster specification diff --git a/models/nodepools/model.tsp b/models/nodepools/model.tsp index 28ea4e1..10ca8d7 100644 --- a/models/nodepools/model.tsp +++ b/models/nodepools/model.tsp @@ -8,6 +8,9 @@ model NodePoolBase { /** * NodePool name (unique in a cluster) */ + @minLength(3) + @maxLength(63) + @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") name: string; /** Cluster specification diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index 78f4670..ca549db 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -725,9 +725,9 @@ components: default: Cluster name: type: string - minLength: 1 + minLength: 3 maxLength: 63 - pattern: ^[a-z0-9-]+$ + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: Cluster name (unique) spec: allOf: @@ -1014,6 +1014,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: @@ -1044,6 +1047,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: @@ -1108,6 +1114,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 599ff34..9e45db1 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -701,9 +701,9 @@ components: default: Cluster name: type: string - minLength: 1 + minLength: 3 maxLength: 63 - pattern: ^[a-z0-9-]+$ + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: Cluster name (unique) spec: allOf: @@ -1085,6 +1085,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: @@ -1115,6 +1118,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: @@ -1198,6 +1204,9 @@ components: description: Resource URI name: type: string + minLength: 3 + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ description: NodePool name (unique in a cluster) spec: allOf: diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 985b837..3b4faa0 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -806,8 +806,8 @@ definitions: name: description: Cluster name (unique) maxLength: 63 - minLength: 1 - pattern: '^[a-z0-9-]+$' + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string spec: allOf: @@ -1210,6 +1210,9 @@ definitions: type: object name: description: NodePool name (unique in a cluster) + maxLength: 63 + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string spec: allOf: @@ -1268,6 +1271,9 @@ definitions: type: object name: description: NodePool name (unique in a cluster) + maxLength: 63 + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string spec: allOf: @@ -1314,6 +1320,9 @@ definitions: type: object name: description: NodePool name (unique in a cluster) + maxLength: 63 + minLength: 3 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' type: string owner_references: $ref: '#/definitions/ObjectReference' From 9e1dccae907f2fc84988848379f3382feb2ecec6 Mon Sep 17 00:00:00 2001 From: Angel Marin Date: Wed, 17 Dec 2025 13:24:50 +0100 Subject: [PATCH 7/7] NodePoolSpec description --- models/nodepools/model.tsp | 2 +- schemas/core/openapi.yaml | 6 +++--- schemas/gcp/openapi.yaml | 6 +++--- schemas/gcp/swagger.yaml | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/models/nodepools/model.tsp b/models/nodepools/model.tsp index 10ca8d7..de07d0e 100644 --- a/models/nodepools/model.tsp +++ b/models/nodepools/model.tsp @@ -13,7 +13,7 @@ model NodePoolBase { @pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$") name: string; - /** Cluster specification + /** NodePool specification * CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job * But CLM will validate the schema before accepting the request */ diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index ca549db..7b20a9f 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -1022,7 +1022,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request NodePoolCreateRequest: @@ -1055,7 +1055,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request example: @@ -1122,7 +1122,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request NodePoolList: diff --git a/schemas/gcp/openapi.yaml b/schemas/gcp/openapi.yaml index 9e45db1..24dfb34 100644 --- a/schemas/gcp/openapi.yaml +++ b/schemas/gcp/openapi.yaml @@ -1093,7 +1093,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request NodePoolCreateRequest: @@ -1126,7 +1126,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request example: @@ -1212,7 +1212,7 @@ components: allOf: - $ref: '#/components/schemas/NodePoolSpec' description: |- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job But CLM will validate the schema before accepting the request NodePoolList: diff --git a/schemas/gcp/swagger.yaml b/schemas/gcp/swagger.yaml index 3b4faa0..57b7cc2 100644 --- a/schemas/gcp/swagger.yaml +++ b/schemas/gcp/swagger.yaml @@ -1218,7 +1218,7 @@ definitions: allOf: - $ref: '#/definitions/NodePoolSpec' description: >- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job @@ -1279,7 +1279,7 @@ definitions: allOf: - $ref: '#/definitions/NodePoolSpec' description: >- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job @@ -1330,7 +1330,7 @@ definitions: allOf: - $ref: '#/definitions/NodePoolSpec' description: >- - Cluster specification + NodePool specification CLM doesn't know how to unmarshall the spec, it only stores and forwards to adapters to do their job