Skip to content

Commit b312e39

Browse files
committed
Add clusterprofileref in order to target a cluster for HCP deployment
Signed-off-by: Adrian Pedriza <adripedriza@gmail.com>
1 parent 065a2cf commit b312e39

File tree

80 files changed

+4982
-3449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4982
-3449
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ run:
1313

1414
linters:
1515
enable:
16-
- depguard # Checks if package imports are in a list of acceptable packages
1716
- gofmt # Checks whether code was gofmt-ed
1817
- goheader # Checks is file headers matche a given pattern
1918
- revive # Stricter drop-in replacement for golint

Makefile.variables

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
KUSTOMIZE_VERSION ?= v5.0.1
2-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
3-
GO_VERSION ?= 1.22.6
4-
GOLANGCILINT_VERSION ?= 1.52.2
2+
CONTROLLER_TOOLS_VERSION ?= v0.17.0
3+
GO_VERSION ?= 1.23.2
4+
GOLANGCILINT_VERSION ?= 1.64.0
55
CRDOC_VERSION ?= v0.6.2
66

77
e2esuite := \

api/k0smotron.io/v1beta1/k0smotroncluster_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import (
3232

3333
// ClusterSpec defines the desired state of K0smotronCluster
3434
type ClusterSpec struct {
35+
// ClusterProfileRef is the reference to the cluster profile.
36+
//+kubebuilder:validation:Optional
37+
ClusterProfileRef *ClusterProfileRef `json:"clusterProfileRef,omitempty"`
3538
// Replicas is the desired number of replicas of the k0s control planes.
3639
// If unspecified, defaults to 1. If the value is above 1, k0smotron requires kine datasource URL to be set.
3740
// Recommended value is 3.
@@ -320,6 +323,16 @@ type CertificateRef struct {
320323
Name string `json:"name,omitempty"`
321324
}
322325

326+
type ClusterProfileRef struct {
327+
// Name is the name of the cluster profile.
328+
//+kubebuilder:validation:Required
329+
Name string `json:"name"`
330+
// InventoryConsumerName is the name of the inventory consumer for a ClusterProfile.
331+
//+kubebuilder:validation:Optional
332+
//+kubebuilder:default=k0smotron
333+
InventoryConsumerName string `json:"inventoryConsumerName,omitempty"`
334+
}
335+
323336
func init() {
324337
SchemeBuilder.Register(&Cluster{}, &ClusterList{})
325338
}

api/k0smotron.io/v1beta1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0scontrollerconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
labels:
88
cluster.x-k8s.io/provider: bootstrap-k0smotron
99
cluster.x-k8s.io/v1beta1: v1beta1

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
labels:
88
cluster.x-k8s.io/provider: bootstrap-k0smotron
99
cluster.x-k8s.io/v1beta1: v1beta1

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
labels:
88
cluster.x-k8s.io/provider: bootstrap-k0smotron
99
cluster.x-k8s.io/v1beta1: v1beta1

config/clusterapi/controlplane/bases/controlplane.cluster.x-k8s.io_k0scontrolplanes.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
labels:
88
cluster.x-k8s.io/provider: control-plane-k0smotron
99
cluster.x-k8s.io/v1beta1: v1beta1
@@ -266,7 +266,6 @@ spec:
266266
the event) or if no container name is specified "spec.containers[2]" (container with
267267
index 2 in this pod). This syntax is chosen only to have some well-defined way of
268268
referencing a part of an object.
269-
TODO: this design is not final and this field is subject to change in the future.
270269
type: string
271270
kind:
272271
description: |-

config/clusterapi/controlplane/bases/controlplane.cluster.x-k8s.io_k0scontrolplanetemplates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
labels:
88
cluster.x-k8s.io/v1beta1: v1beta1
99
name: k0scontrolplanetemplates.controlplane.cluster.x-k8s.io

0 commit comments

Comments
 (0)