Skip to content

Commit

Permalink
docs: Adjust CRD field comments
Browse files Browse the repository at this point in the history
  • Loading branch information
avorima authored and wikkyk committed Apr 8, 2024
1 parent b4478a0 commit 0c6f87c
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 65 deletions.
30 changes: 15 additions & 15 deletions api/v1alpha1/proxmoxcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
)

const (
// ProxmoxClusterKind the ProxmoxCluster kind.
// ProxmoxClusterKind is the ProxmoxCluster kind.
ProxmoxClusterKind = "ProxmoxCluster"
// ClusterFinalizer allows cleaning up resources associated with
// ClusterFinalizer allows cleaning up resources associated with a
// ProxmoxCluster before removing it from the apiserver.
ClusterFinalizer = "proxmoxcluster.infrastructure.cluster.x-k8s.io"
)

// ProxmoxClusterSpec defines the desired state of ProxmoxCluster.
// ProxmoxClusterSpec defines the desired state of a ProxmoxCluster.
type ProxmoxClusterSpec struct {
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
// +optional
Expand All @@ -50,20 +50,20 @@ type ProxmoxClusterSpec struct {
SchedulerHints *SchedulerHints `json:"schedulerHints,omitempty"`

// IPv4Config contains information about available IPV4 address pools and the gateway.
// this can be combined with ipv6Config in order to enable dual stack.
// either IPv4Config or IPv6Config must be provided.
// This can be combined with ipv6Config in order to enable dual stack.
// Either IPv4Config or IPv6Config must be provided.
// +optional
// +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv4Config addresses must be provided"
IPv4Config *IPConfigSpec `json:"ipv4Config,omitempty"`

// IPv6Config contains information about available IPV6 address pools and the gateway.
// this can be combined with ipv4Config in order to enable dual stack.
// either IPv4Config or IPv6Config must be provided.
// This can be combined with ipv4Config in order to enable dual stack.
// Either IPv4Config or IPv6Config must be provided.
// +optional
// +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv6Config addresses must be provided"
IPv6Config *IPConfigSpec `json:"ipv6Config,omitempty"`

// DNSServers contains information about nameservers used by machines network-config.
// DNSServers contains information about nameservers used by machines' network config.
// +kubebuilder:validation:MinItems=1
DNSServers []string `json:"dnsServers"`
}
Expand Down Expand Up @@ -105,14 +105,14 @@ func (sh *SchedulerHints) GetMemoryAdjustment() uint64 {
return memoryAdjustment
}

// ProxmoxClusterStatus defines the observed state of ProxmoxCluster.
// ProxmoxClusterStatus defines the observed state of a ProxmoxCluster.
type ProxmoxClusterStatus struct {
// Ready indicates that the cluster is ready.
// +optional
// +kubebuilder:default=false
Ready bool `json:"ready"`

// InClusterIPPoolRef is the reference to the created in cluster ip pool
// InClusterIPPoolRef is the reference to the created in-cluster IP pool.
// +optional
InClusterIPPoolRef []corev1.LocalObjectReference `json:"inClusterIpPoolRef,omitempty"`

Expand All @@ -129,22 +129,22 @@ type ProxmoxClusterStatus struct {
// NodeLocations holds information about the deployment state of
// control plane and worker nodes in Proxmox.
type NodeLocations struct {
// ControlPlane contains all deployed control plane nodes
// ControlPlane contains all deployed control plane nodes.
// +optional
ControlPlane []NodeLocation `json:"controlPlane,omitempty"`

// Workers contains all deployed worker nodes
// Workers contains all deployed worker nodes.
// +optional
Workers []NodeLocation `json:"workers,omitempty"`
}

// NodeLocation holds information about a single VM
// in Proxmox.
type NodeLocation struct {
// Machine is the reference of the proxmoxmachine
// Machine is the reference to the ProxmoxMachine.
Machine corev1.LocalObjectReference `json:"machine"`

// Node is the Proxmox node
// Node is the Proxmox node.
Node string `json:"node"`
}

Expand Down Expand Up @@ -210,7 +210,7 @@ func (c *ProxmoxCluster) SetInClusterIPPoolRef(pool client.Object) {
}

// AddNodeLocation will add a node location to either the control plane or worker
// node locations based on the `isControlPlane` parameter.
// node locations based on the isControlPlane parameter.
func (c *ProxmoxCluster) AddNodeLocation(loc NodeLocation, isControlPlane bool) {
if c.Status.NodeLocations == nil {
c.Status.NodeLocations = new(NodeLocations)
Expand Down
28 changes: 14 additions & 14 deletions api/v1alpha1/proxmoxmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// ProxmoxMachineKind is the ProxmoxMachine kind.
ProxmoxMachineKind = "ProxmoxMachine"

// MachineFinalizer allows cleaning up resources associated with
// MachineFinalizer allows cleaning up resources associated with a
// ProxmoxMachine before removing it from the API Server.
MachineFinalizer = "proxmoxmachine.infrastructure.cluster.x-k8s.io"

Expand All @@ -50,7 +50,7 @@ const (
IPV6Format = "v6"
)

// ProxmoxMachineSpec defines the desired state of ProxmoxMachine.
// ProxmoxMachineSpec defines the desired state of a ProxmoxMachine.
type ProxmoxMachineSpec struct {
VirtualMachineCloneSpec `json:",inline"`

Expand All @@ -59,7 +59,7 @@ type ProxmoxMachineSpec struct {
// +optional
ProviderID *string `json:"providerID,omitempty"`

// VirtualMachineID is the Proxmox identifier for the ProxmoxMachine vm.
// VirtualMachineID is the Proxmox identifier for the ProxmoxMachine VM.
// +optional
VirtualMachineID *int64 `json:"virtualMachineID,omitempty"`

Expand Down Expand Up @@ -249,7 +249,7 @@ type RouteSpec struct {
Table uint32 `json:"table,omitempty"`
}

// RoutingPolicySpec is a linux FIB rule.
// RoutingPolicySpec is a Linux FIB rule.
type RoutingPolicySpec struct {
// To is the subnet of the target.
// +optional
Expand All @@ -259,11 +259,11 @@ type RoutingPolicySpec struct {
// +optional
From string `json:"from,omitempty"`

// Table is the routing table id.
// Table is the routing table ID.
// +optional
Table uint32 `json:"table,omitempty"`

// Priority is the position in the ip rule fib table.
// Priority is the position in the ip rule FIB table.
// +kubebuilder:validation:Maximum=4294967295
// +kubebuilder:validation:XValidation:message="Cowardly refusing to insert fib rule matching kernel rules",rule="(self > 0 && self < 32765) || (self > 32766)"
// +optional
Expand All @@ -276,7 +276,7 @@ type VRFDevice struct {
Interfaces []string `json:"interfaces,omitempty"`

// Name is the virtual network device name.
// must be unique within the virtual machine.
// Must be unique within the virtual machine.
// +kubebuilder:validation:MinLength=3
Name string `json:"name"`

Expand All @@ -294,15 +294,15 @@ type VRFDevice struct {
// +kubebuilder:validation:MinItems=1
Routes []RouteSpec `json:"routes,omitempty"`

// RoutingPolicy is the l3mdev policy inserted into FiB.
// RoutingPolicy is the l3mdev policy inserted into FIB.
// +optional
// +kubebuilder:validation:MinItems=1
RoutingPolicy []RoutingPolicySpec `json:"routingPolicy,omitempty"`
}

// VirtualNetworkDevices defines linux software networking devices.
// VirtualNetworkDevices defines Linux software networking devices.
type VirtualNetworkDevices struct {
// Definition of a Vrf Device.
// Definition of a VRF Device.
// +optional
// +listType=map
// +listMapKey=name
Expand Down Expand Up @@ -342,7 +342,7 @@ type AdditionalNetworkDevice struct {
NetworkDevice `json:",inline"`

// Name is the network device name.
// must be unique within the virtual machine and different from the primary device 'net0'.
// Must be unique within the virtual machine and different from the primary device 'net0'.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self != 'net0'",message="additional network devices doesn't allow net0"
Name string `json:"name"`
Expand Down Expand Up @@ -370,7 +370,7 @@ type AdditionalNetworkDevice struct {
DNSServers []string `json:"dnsServers,omitempty"`
}

// ProxmoxMachineStatus defines the observed state of ProxmoxMachine.
// ProxmoxMachineStatus defines the observed state of a ProxmoxMachine.
type ProxmoxMachineStatus struct {
// Ready indicates the Docker infrastructure has been provisioned and is ready.
// +optional
Expand Down Expand Up @@ -457,11 +457,11 @@ type ProxmoxMachineStatus struct {

// IPAddress defines the IP addresses of a network interface.
type IPAddress struct {
// IPV4 is the IP v4 address.
// IPV4 is the IPv4 address.
// +optional
IPV4 string `json:"ipv4,omitempty"`

// IPV6 is the IP v6 address.
// IPV6 is the IPv6 address.
// +optional
IPV6 string `json:"ipv6,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
metadata:
type: object
spec:
description: ProxmoxClusterSpec defines the desired state of ProxmoxCluster.
description: ProxmoxClusterSpec defines the desired state of a ProxmoxCluster.
properties:
allowedNodes:
description: AllowedNodes specifies all Proxmox nodes which will be
Expand All @@ -74,15 +74,15 @@ spec:
type: object
dnsServers:
description: DNSServers contains information about nameservers used
by machines network-config.
by machines' network config.
items:
type: string
minItems: 1
type: array
ipv4Config:
description: IPv4Config contains information about available IPV4
address pools and the gateway. this can be combined with ipv6Config
in order to enable dual stack. either IPv4Config or IPv6Config must
address pools and the gateway. This can be combined with ipv6Config
in order to enable dual stack. Either IPv4Config or IPv6Config must
be provided.
properties:
addresses:
Expand All @@ -107,8 +107,8 @@ spec:
rule: self.addresses.size() > 0
ipv6Config:
description: IPv6Config contains information about available IPV6
address pools and the gateway. this can be combined with ipv4Config
in order to enable dual stack. either IPv4Config or IPv6Config must
address pools and the gateway. This can be combined with ipv4Config
in order to enable dual stack. Either IPv4Config or IPv6Config must
be provided.
properties:
addresses:
Expand Down Expand Up @@ -154,7 +154,7 @@ spec:
- message: at least one ip config must be set, either ipv4Config or ipv6Config
rule: self.ipv4Config != null || self.ipv6Config != null
status:
description: ProxmoxClusterStatus defines the observed state of ProxmoxCluster.
description: ProxmoxClusterStatus defines the observed state of a ProxmoxCluster.
properties:
conditions:
description: Conditions defines current service state of the ProxmoxCluster.
Expand Down Expand Up @@ -202,8 +202,8 @@ spec:
type: object
type: array
inClusterIpPoolRef:
description: InClusterIPPoolRef is the reference to the created in
cluster ip pool
description: InClusterIPPoolRef is the reference to the created in-cluster
IP pool.
items:
description: LocalObjectReference contains enough information to
let you locate the referenced object inside the same namespace.
Expand All @@ -221,13 +221,13 @@ spec:
properties:
controlPlane:
description: ControlPlane contains all deployed control plane
nodes
nodes.
items:
description: NodeLocation holds information about a single VM
in Proxmox.
properties:
machine:
description: Machine is the reference of the proxmoxmachine
description: Machine is the reference to the ProxmoxMachine.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Expand All @@ -236,21 +236,21 @@ spec:
type: object
x-kubernetes-map-type: atomic
node:
description: Node is the Proxmox node
description: Node is the Proxmox node.
type: string
required:
- machine
- node
type: object
type: array
workers:
description: Workers contains all deployed worker nodes
description: Workers contains all deployed worker nodes.
items:
description: NodeLocation holds information about a single VM
in Proxmox.
properties:
machine:
description: Machine is the reference of the proxmoxmachine
description: Machine is the reference to the ProxmoxMachine.
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Expand All @@ -259,7 +259,7 @@ spec:
type: object
x-kubernetes-map-type: atomic
node:
description: Node is the Proxmox node
description: Node is the Proxmox node.
type: string
required:
- machine
Expand Down
Loading

0 comments on commit 0c6f87c

Please sign in to comment.