Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions api/v1beta1/nutanixmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)
Expand All @@ -25,14 +26,23 @@ import (

const (
// NutanixMachineTemplateKind represents the Kind of NutanixMachineTemplate
NutanixMachineTemplateKind = "NutanixMachineTemplate"
NutanixMachineTemplateKind = "NutanixMachineTemplate"
AutoscalerResourceCPU corev1.ResourceName = "cpu"
AutoscalerResourceMemory corev1.ResourceName = "memory"
// NutanixMachineTemplateFinalizer is the finalizer for NutanixMachineTemplate objects
NutanixMachineTemplateFinalizer = "infrastructure.cluster.x-k8s.io/nutanixmachinetemplate"
)

// NutanixMachineTemplateSpec defines the desired state of NutanixMachineTemplate
type NutanixMachineTemplateSpec struct {
Template NutanixMachineTemplateResource `json:"template"`
}

// NutanixMachineTemplateStatus defines the observed state of a NutanixMachineTemplate
type NutanixMachineTemplateStatus struct {
Capacity corev1.ResourceList `json:"capacity,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:resource:path=nutanixmachinetemplates,shortName=nmtmpl,scope=Namespaced,categories=cluster-api
//+kubebuilder:storageversion
Expand All @@ -42,7 +52,8 @@ type NutanixMachineTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NutanixMachineTemplateSpec `json:"spec,omitempty"`
Spec NutanixMachineTemplateSpec `json:"spec,omitempty"`
Status NutanixMachineTemplateStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
23 changes: 23 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ spec:
required:
- template
type: object
status:
description: NutanixMachineTemplateStatus defines the observed state of
a NutanixMachineTemplate
properties:
capacity:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: ResourceList is a set of (resource name, quantity) pairs.
type: object
type: object
type: object
served: true
storage: true
3 changes: 3 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rules:
- nutanixclusters
- nutanixfailuredomains
- nutanixmachines
- nutanixmachinetemplates
verbs:
- create
- delete
Expand All @@ -73,6 +74,7 @@ rules:
resources:
- nutanixclusters/finalizers
- nutanixmachines/finalizers
- nutanixmachinetemplates/finalizers
verbs:
- update
- apiGroups:
Expand All @@ -82,6 +84,7 @@ rules:
- nutanixfailuredomains/finalizers
- nutanixfailuredomains/status
- nutanixmachines/status
- nutanixmachinetemplates/status
verbs:
- get
- patch
Expand Down
Loading
Loading