Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
fix: invalid markers on resources
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
  • Loading branch information
shanduur committed May 29, 2024
1 parent 7f3f9e0 commit bcf973f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
42 changes: 21 additions & 21 deletions api/v1alpha1/lkeclusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand All @@ -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"`
}

Expand All @@ -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"`
}

Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/lke.anza-labs.dev_lkeclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/.crd-ref-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ processor:

render:
# Version of Kubernetes to use when generating links to Kubernetes API documentation.
kubernetesVersion: 1.30
kubernetesVersion: 'v1.30'
22 changes: 11 additions & 11 deletions docs/reference/out.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)_ | | | |


Expand All @@ -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.<br />If not provided, then default token will be used. | | |
| `highAvailability` _boolean_ | HighAvailability specifies whether the LKE cluster should be configured for high<br />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: {} <br /> |
| `tokenSecretRef` _[SecretRef](#secretref)_ | TokenSecretRef references the Kubernetes secret that stores the Linode API token.<br />If not provided, then default token will be used. | | Required: {} <br /> |
| `highAvailability` _boolean_ | HighAvailability specifies whether the LKE cluster should be configured for high<br />availability. | false | Optional: {} <br /> |
| `nodePools` _object (keys:string, values:[LKENodePool](#lkenodepool))_ | NodePools contains the specifications for each node pool within the LKE cluster. | | MinProperties: 1 <br />Required: {} <br /> |
| `kubernetesVersion` _string_ | KubernetesVersion indicates the Kubernetes version of the LKE cluster. | latest | Optional: {} <br /> |


#### LKENodePool
Expand All @@ -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: {} <br /> |
| `linodeType` _string_ | LinodeType specifies the Linode instance type for the nodes in the pool. | | Required: {} <br /> |
| `autoscaler` _[LKENodePoolAutoscaler](#lkenodepoolautoscaler)_ | Autoscaler specifies the autoscaling configuration for the node pool. | | Optional: {} <br /> |


#### LKENodePoolAutoscaler
Expand All @@ -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 <br />Minimum: 0 <br />Required: {} <br /> |
| `max` _integer_ | Max specifies the maximum number of nodes in the pool. | | Maximum: 100 <br />Minimum: 3 <br />Required: {} <br /> |



Expand Down

0 comments on commit bcf973f

Please sign in to comment.