From bcf973fb237c523d9ae5bc2e50d9b38bf5a5466a Mon Sep 17 00:00:00 2001 From: Mateusz Urbanek Date: Wed, 29 May 2024 18:33:40 +0200 Subject: [PATCH] fix: invalid markers on resources Signed-off-by: Mateusz Urbanek --- Makefile | 4 +- api/v1alpha1/lkeclusterconfig_types.go | 42 +++++++++---------- .../lke.anza-labs.dev_lkeclusterconfigs.yaml | 9 ++++ docs/.crd-ref-docs.yaml | 2 +- docs/reference/out.md | 22 +++++----- 5 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 92a175f..66632e9 100644 --- a/Makefile +++ b/Makefile @@ -167,12 +167,12 @@ $(CHAINSAW): $(LOCALBIN) .PHONY: golangci-lint golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. $(GOLANGCI_LINT): $(LOCALBIN) - $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION}) + $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION)) .PHONY: crd-ref-docs crd-ref-docs: $(CRD_REF_DOCS) ## Download crd-ref-docs locally if necessary. $(CRD_REF_DOCS): $(LOCALBIN) - $(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs,${CRD_REF_DOCS_VERSION}) + $(call go-install-tool,$(CRD_REF_DOCS),github.com/elastic/crd-ref-docs,$(CRD_REF_DOCS_VERSION)) .PHONY: gowrap gowrap: $(GOWRAP) diff --git a/api/v1alpha1/lkeclusterconfig_types.go b/api/v1alpha1/lkeclusterconfig_types.go index bea8beb..e9b4354 100644 --- a/api/v1alpha1/lkeclusterconfig_types.go +++ b/api/v1alpha1/lkeclusterconfig_types.go @@ -23,27 +23,27 @@ import ( // LKEClusterConfigSpec defines the desired state of an LKEClusterConfig resource. type LKEClusterConfigSpec struct { // Region is the geographical region where the LKE cluster will be provisioned. - // +kubebuilder:validation:required + // +kubebuilder:validation:Required Region string `json:"region"` // TokenSecretRef references the Kubernetes secret that stores the Linode API token. // If not provided, then default token will be used. - // +kubebuilder:validation:required + // +kubebuilder:validation:Required TokenSecretRef SecretRef `json:"tokenSecretRef"` // HighAvailability specifies whether the LKE cluster should be configured for high // availability. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional // +kubebuilder:default=false HighAvailability *bool `json:"highAvailability,omitempty"` // NodePools contains the specifications for each node pool within the LKE cluster. - // +kubebuilder:validation:required - // +kubebuilder:validation:minProperties=1 + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinProperties=1 NodePools map[string]LKENodePool `json:"nodePools"` // KubernetesVersion indicates the Kubernetes version of the LKE cluster. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional // +kubebuilder:default=latest KubernetesVersion *string `json:"kubernetesVersion,omitempty"` } @@ -57,15 +57,15 @@ type SecretRef struct { // LKENodePool represents a pool of nodes within the LKE cluster. type LKENodePool struct { // NodeCount specifies the number of nodes in the node pool. - // +kubebuilder:validation:required + // +kubebuilder:validation:Required NodeCount int `json:"nodeCount"` // LinodeType specifies the Linode instance type for the nodes in the pool. - // +kubebuilder:validation:required + // +kubebuilder:validation:Required LinodeType string `json:"linodeType"` // Autoscaler specifies the autoscaling configuration for the node pool. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"` } @@ -92,46 +92,46 @@ func (l LKENodePool) IsEqual(cmp LKENodePool) bool { // LKENodePoolAutoscaler represents the autoscaler configuration for a node pool. type LKENodePoolAutoscaler struct { // Min specifies the minimum number of nodes in the pool. - // +kubebuilder:validation:required - // +kubebuilder:validation:minimum=0 - // +kubebuilder:validation:maximum=100 + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 Min int `json:"min"` // Max specifies the maximum number of nodes in the pool. - // +kubebuilder:validation:required - // +kubebuilder:validation:minimum=3 - // +kubebuilder:validation:maximum=100 + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum=3 + // +kubebuilder:validation:Maximum=100 Max int `json:"max"` } // LKEClusterConfigStatus defines the observed state of an LKEClusterConfig resource. type LKEClusterConfigStatus struct { // Phase represents the current phase of the LKE cluster. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional // +kubebuilder:default=Unknown Phase *Phase `json:"phase,omitempty"` // ClusterID contains the ID of the provisioned LKE cluster. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional ClusterID *int `json:"clusterID,omitempty"` // NodePoolStatuses contains the Status of the provisioned node pools within the LKE cluster. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional NodePoolStatuses map[string]NodePoolStatus `json:"nodePoolStatuses,omitempty"` // FailureMessage contains an optional failure message for the LKE cluster. - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional FailureMessage *string `json:"failureMessage,omitempty"` } // NodePoolStatus type NodePoolStatus struct { // ID - // +kubebuilder:validation:optional + // +kubebuilder:validation:Optional ID *int `json:"id,omitempty"` // NodePoolDetails - // +kubebuilder:validation:required + // +kubebuilder:validation:Required NodePoolDetails LKENodePool `json:"details"` } diff --git a/config/crd/bases/lke.anza-labs.dev_lkeclusterconfigs.yaml b/config/crd/bases/lke.anza-labs.dev_lkeclusterconfigs.yaml index fcd32a6..2997627 100644 --- a/config/crd/bases/lke.anza-labs.dev_lkeclusterconfigs.yaml +++ b/config/crd/bases/lke.anza-labs.dev_lkeclusterconfigs.yaml @@ -78,10 +78,14 @@ spec: max: description: Max specifies the maximum number of nodes in the pool. + maximum: 100 + minimum: 3 type: integer min: description: Min specifies the minimum number of nodes in the pool. + maximum: 100 + minimum: 0 type: integer required: - max @@ -101,6 +105,7 @@ spec: type: object description: NodePools contains the specifications for each node pool within the LKE cluster. + minProperties: 1 type: object region: description: Region is the geographical region where the LKE cluster @@ -149,10 +154,14 @@ spec: max: description: Max specifies the maximum number of nodes in the pool. + maximum: 100 + minimum: 3 type: integer min: description: Min specifies the minimum number of nodes in the pool. + maximum: 100 + minimum: 0 type: integer required: - max diff --git a/docs/.crd-ref-docs.yaml b/docs/.crd-ref-docs.yaml index 3839b5b..ca1cd20 100644 --- a/docs/.crd-ref-docs.yaml +++ b/docs/.crd-ref-docs.yaml @@ -10,4 +10,4 @@ processor: render: # Version of Kubernetes to use when generating links to Kubernetes API documentation. - kubernetesVersion: 1.30 + kubernetesVersion: 'v1.30' diff --git a/docs/reference/out.md b/docs/reference/out.md index ffb90bb..b9392e9 100644 --- a/docs/reference/out.md +++ b/docs/reference/out.md @@ -27,7 +27,7 @@ LKEClusterConfig is the Schema for the lkeclusterconfigs API. | --- | --- | --- | --- | | `apiVersion` _string_ | `lke.anza-labs.dev/v1alpha1` | | | | `kind` _string_ | `LKEClusterConfig` | | | -| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.3/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | | | `spec` _[LKEClusterConfigSpec](#lkeclusterconfigspec)_ | | | | @@ -44,11 +44,11 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `region` _string_ | Region is the geographical region where the LKE cluster will be provisioned. | | | -| `tokenSecretRef` _[SecretRef](#secretref)_ | TokenSecretRef references the Kubernetes secret that stores the Linode API token.
If not provided, then default token will be used. | | | -| `highAvailability` _boolean_ | HighAvailability specifies whether the LKE cluster should be configured for high
availability. | false | | -| `nodePools` _object (keys:string, values:[LKENodePool](#lkenodepool))_ | NodePools contains the specifications for each node pool within the LKE cluster. | | | -| `kubernetesVersion` _string_ | KubernetesVersion indicates the Kubernetes version of the LKE cluster. | latest | | +| `region` _string_ | Region is the geographical region where the LKE cluster will be provisioned. | | Required: {}
| +| `tokenSecretRef` _[SecretRef](#secretref)_ | TokenSecretRef references the Kubernetes secret that stores the Linode API token.
If not provided, then default token will be used. | | Required: {}
| +| `highAvailability` _boolean_ | HighAvailability specifies whether the LKE cluster should be configured for high
availability. | false | Optional: {}
| +| `nodePools` _object (keys:string, values:[LKENodePool](#lkenodepool))_ | NodePools contains the specifications for each node pool within the LKE cluster. | | MinProperties: 1
Required: {}
| +| `kubernetesVersion` _string_ | KubernetesVersion indicates the Kubernetes version of the LKE cluster. | latest | Optional: {}
| #### LKENodePool @@ -65,9 +65,9 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `nodeCount` _integer_ | NodeCount specifies the number of nodes in the node pool. | | | -| `linodeType` _string_ | LinodeType specifies the Linode instance type for the nodes in the pool. | | | -| `autoscaler` _[LKENodePoolAutoscaler](#lkenodepoolautoscaler)_ | Autoscaler specifies the autoscaling configuration for the node pool. | | | +| `nodeCount` _integer_ | NodeCount specifies the number of nodes in the node pool. | | Required: {}
| +| `linodeType` _string_ | LinodeType specifies the Linode instance type for the nodes in the pool. | | Required: {}
| +| `autoscaler` _[LKENodePoolAutoscaler](#lkenodepoolautoscaler)_ | Autoscaler specifies the autoscaling configuration for the node pool. | | Optional: {}
| #### LKENodePoolAutoscaler @@ -83,8 +83,8 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `min` _integer_ | Min specifies the minimum number of nodes in the pool. | | | -| `max` _integer_ | Max specifies the maximum number of nodes in the pool. | | | +| `min` _integer_ | Min specifies the minimum number of nodes in the pool. | | Maximum: 100
Minimum: 0
Required: {}
| +| `max` _integer_ | Max specifies the maximum number of nodes in the pool. | | Maximum: 100
Minimum: 3
Required: {}
|