package v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// HarvesterBlueprintSpec defines the desired state of HarvesterBlueprint
type HarvesterBlueprintSpec struct {
	// HarvesterURL is the endpoint of the Harvester cluster (e.g. https://10.x.x.x:6443).
	// This replaces the need for auto-discovery.
	// +required
	HarvesterURL string `json:"harvesterUrl"`

	// VmNamespace is the namespace in Harvester where VMs will be created.
	// +required
	VmNamespace string `json:"vmNamespace"`

	// ImageName is the specific image name in Harvester to clone (e.g. image-abcde).
	// +required
	ImageName string `json:"imageName"`

	// NetworkName is the VM Network to attach to the nodes.
	// +required
	NetworkName string `json:"networkName"`

	// SshUser is the username to configure on the VM (e.g. ubuntu, rancher).
	// +required
	SshUser string `json:"sshUser"`
}

// HarvesterBlueprintStatus defines the observed state of HarvesterBlueprint
type HarvesterBlueprintStatus struct {
	// Ready indicates the configuration is valid (optional future use)
	Ready bool `json:"ready,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=hbp
type HarvesterBlueprint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HarvesterBlueprintSpec   `json:"spec,omitempty"`
	Status HarvesterBlueprintStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// HarvesterBlueprintList contains a list of HarvesterBlueprint
type HarvesterBlueprintList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HarvesterBlueprint `json:"items"`
}

func init() {
	SchemeBuilder.Register(&HarvesterBlueprint{}, &HarvesterBlueprintList{})
}
