Skip to content

Commit

Permalink
[DOCS] Revise API comments
Browse files Browse the repository at this point in the history
Edit field descriptions.

Signed-off-by: dzhigzhitzhapov <[email protected]>
  • Loading branch information
dzhigzhitzhapov committed Apr 15, 2024
1 parent ae51bd3 commit db6482a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 56 deletions.
6 changes: 3 additions & 3 deletions api/bootstrap/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
)

var (
// defines the version of the API resources
// Defines the version of the API resources.
GroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"}

// adds the Go types to the GroupVersionKind scheme
// Adds the Go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// adds the types of the GroupVersion to the given scheme
// Adds the types of the GroupVersion to the given scheme
AddToScheme = SchemeBuilder.AddToScheme
)
80 changes: 40 additions & 40 deletions api/bootstrap/v1beta1/k0s_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,58 +52,58 @@ type K0sWorkerConfigList struct {
}

type K0sWorkerConfigSpec struct {
// JoinTokenSecretRef is a reference to a secret that contains the join token.
// This should be only set in the case you want to use a pre-generated join token.
// The secret that contains the join token.
// Specify the secret only when using a pre-generated join token.
// +kubebuilder:validation:Optional
JoinTokenSecretRef *JoinTokenSecretRef `json:"joinTokenSecretRef,omitempty"`

// Version is the version of k0s to use. In case this is not set, k0smotron will use
// a version field of the Machine object. If it's empty, the latest version is used.
// The version of k0s to be deployed. If the parameter is not set, k0smotron uses
// the Version field of the Machine object. If the Version field is empty, the latest version of k0s is used.
// Make sure the version is compatible with the k0s version running on the control plane.
// For reference see the Kubernetes version skew policy: https://kubernetes.io/docs/setup/release/version-skew-policy/
// For reference, see the Kubernetes version skew policy: https://kubernetes.io/docs/setup/release/version-skew-policy/.
// +kubebuilder:validation:Optional
Version string `json:"version,omitempty"`

// Files specifies extra files to be passed to user_data upon creation.
// Additional files to be passed to user_data upon creation.
// +kubebuilder:validation:Optional
Files []cloudinit.File `json:"files,omitempty"`

// Args specifies extra arguments to be passed to k0s worker.
// Additional arguments to be passed to the k0s worker node.
// See: https://docs.k0sproject.io/stable/advanced/worker-configuration/
Args []string `json:"args,omitempty"`

// PreStartCommands specifies commands to be run before starting k0s worker.
// Commands that should be executed before the k0s worker node start.
// +kubebuilder:validation:Optional
PreStartCommands []string `json:"preStartCommands,omitempty"`

// PostStartCommands specifies commands to be run after starting k0s worker.
// Commands that should be executed after the k0s worker node start.
// +kubebuilder:validation:Optional
PostStartCommands []string `json:"postStartCommands,omitempty"`

// PreInstallK0s specifies whether k0s binary is pre-installed on the node.
// Specifies whether k0s binary is pre-installed on the node.
// +kubebuilder:validation:Optional
PreInstalledK0s bool `json:"preInstalledK0s,omitempty"`

// DownloadURL specifies the URL to download k0s binary from.
// If specified the version field is ignored and what ever version is downloaded from the URL is used.
// The URL from which the k0s binary should be downloaded.
// If the Version field is empty, the downloaded version of k0s is used.
// +kubebuilder:validation:Optional
DownloadURL string `json:"downloadURL,omitempty"`
}

type JoinTokenSecretRef struct {
// Name is the name of the secret
// The name of the secret with the join token.
// +kubebuilder:validation:Required
Name string `json:"name"`
// Key is the key in the secret that contains the join token
// The key of the secret that contains the join token.
// +kubebuilder:validation:Required
Key string `json:"key"`
}

type K0sWorkerConfigStatus struct {
// Ready indicates the Bootstrapdata field is ready to be consumed
// Indicates whether the Bootstrapdata field is ready to be consumed.
Ready bool `json:"ready,omitempty"`

// DataSecretName is the name of the secret that stores the bootstrap data script.
// The name of the secret that stores the bootstrap data script.
// +optional
DataSecretName *string `json:"dataSecretName,omitempty"`
// TODO Conditions etc
Expand All @@ -123,10 +123,10 @@ type K0sControllerConfig struct {
}

type K0sControllerConfigStatus struct {
// Ready indicates the Bootstrapdata field is ready to be consumed
// Indicates whether the Bootstrapdata field is ready to be consumed.
Ready bool `json:"ready,omitempty"`

// DataSecretName is the name of the secret that stores the bootstrap data script.
// The name of the secret that stores the bootstrap data script.
// +optional
DataSecretName *string `json:"dataSecretName,omitempty"`
}
Expand All @@ -140,74 +140,74 @@ type K0sControllerConfigList struct {
}

type K0sControllerConfigSpec struct {
// Version is the version of k0s to use. In case this is not set, k0smotron will use
// a version field of the Machine object. If it's empty, the latest version is used.
// The version of k0s to be deployed. If the parameter is not set, k0smotron uses
// the Version field of the Machine object. If the Version field is empty, the latest version of k0s is used.
// Make sure the version is compatible with the k0s version running on the control plane.
// For reference see the Kubernetes version skew policy: https://kubernetes.io/docs/setup/release/version-skew-policy/
// For reference, see the Kubernetes version skew policy: https://kubernetes.io/docs/setup/release/version-skew-policy/.
// +kubebuilder:validation:Optional
Version string `json:"version,omitempty"`

*K0sConfigSpec `json:",inline"`
}

type K0sConfigSpec struct {
// K0s defines the k0s configuration. Note, that some fields will be overwritten by k0smotron.
// If empty, will be used default configuration. @see https://docs.k0sproject.io/stable/configuration/
// Defines the k0s configuration. Note, that some fields will be overwritten by k0smotron.
// If empty, the default k0s configuration is used. For details, see https://docs.k0sproject.io/stable/configuration/.
//+kubebuilder:validation:Optional
//+kubebuilder:pruning:PreserveUnknownFields
K0s *unstructured.Unstructured `json:"k0s,omitempty"`

// Files specifies extra files to be passed to user_data upon creation.
// Additinal files to be passed to user_data upon creation.
// +kubebuilder:validation:Optional
Files []cloudinit.File `json:"files,omitempty"`

// Args specifies extra arguments to be passed to k0s worker.
// Additional extra arguments to be passed to the k0s worker node.
// See: https://docs.k0sproject.io/stable/advanced/worker-configuration/
Args []string `json:"args,omitempty"`

// PreStartCommands specifies commands to be run before starting k0s worker.
// Commands that should be executed before the k0s worker node start.
// +kubebuilder:validation:Optional
PreStartCommands []string `json:"preStartCommands,omitempty"`

// PostStartCommands specifies commands to be run after starting k0s worker.
// Commands that should be executed after the k0s worker node start.
// +kubebuilder:validation:Optional
PostStartCommands []string `json:"postStartCommands,omitempty"`

// PreInstallK0s specifies whether k0s binary is pre-installed on the node.
// Specifies whether k0s binary is pre-installed on the node.
// +kubebuilder:validation:Optional
PreInstalledK0s bool `json:"preInstalledK0s,omitempty"`

// DownloadURL specifies the URL from which to download the k0s binary.
// If the version field is specified, it is ignored, and whatever version is downloaded from the URL is used.
// The URL from which the k0s binary should be downloaded.
// If the Version field is empty, the downloaded version of k0s is used.
// +kubebuilder:validation:Optional
DownloadURL string `json:"downloadURL,omitempty"`

// Tunneling defines the tunneling configuration for the cluster.
// The tunneling configuration for the cluster.
//+kubebuilder:validation:Optional
Tunneling TunnelingSpec `json:"tunneling,omitempty"`
}

type TunnelingSpec struct {
// Enabled specifies whether tunneling is enabled.
// Specifies whether tunneling is enabled.
//+kubebuilder:validation:Optional
//+kubebuilder:default=false
Enabled bool `json:"enabled,omitempty"`
// Server address of the tunneling server.
// If empty, k0smotron will try to detect worker node address for.
// The address of the tunneling server.
// If empty, k0smotron tries to detect the address of the worker node.
//+kubebuilder:validation:Optional
ServerAddress string `json:"serverAddress,omitempty"`
// NodePort to publish for server port of the tunneling server.
// If empty, k0smotron will use the default one.
// Defines the NodePort to be used as the server port of the tunneling server.
// If empty, k0smotron uses the default port.
//+kubebuilder:validation:Optional
//+kubebuilder:default=31700
ServerNodePort int32 `json:"serverNodePort,omitempty"`
// NodePort to publish for tunneling port.
// If empty, k0smotron will use the default one.
// Defines the NodePort to be used as the tunneling port.
// If empty, k0smotron uses the default port.
//+kubebuilder:validation:Optional
//+kubebuilder:default=31443
TunnelingNodePort int32 `json:"tunnelingNodePort,omitempty"`
// Mode describes tunneling mode.
// If empty, k0smotron will use the default one.
// Defines the tunneling mode.
// If empty, k0smotron uses the default mode.
//+kubebuilder:validation:Enum=tunnel;proxy
//+kubebuilder:default=tunnel
Mode string `json:"mode,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions api/controlplane/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (
)

var (
// GroupVersion is group version used to register these objects
// Defines the version of the API resources.
GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
// Adds the Go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
// Adds the types of the GroupVersion to the given scheme
AddToScheme = SchemeBuilder.AddToScheme
)
20 changes: 10 additions & 10 deletions api/controlplane/v1beta1/k0s_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,46 @@ type K0sControlPlaneSpec struct {
//+kubebuilder:validation:Optional
//+kubebuilder:default=1
Replicas int32 `json:"replicas,omitempty"`
// Version defines the k0s version to be deployed. You can use a specific k0s version (e.g. v1.27.1+k0s.0) or
// The k0s version to be deployed. You can use a specific k0s version (e.g. v1.27.1+k0s.0) or
// just the Kubernetes version (e.g. v1.27.1). If left empty, k0smotron will select one automatically.
//+kubebuilder:validation:Optional
Version string `json:"version,omitempty"`
}

type K0sBootstrapConfigSpec struct {
// Files specifies extra files to be passed to user_data upon creation.
// Additional files to be passed to user_data upon creation.
// +kubebuilder:validation:Optional
Files []cloudinit.File `json:"files,omitempty"`

// Args specifies extra arguments to be passed to k0s worker.
// Additional arguments to be passed to the k0s worker node.
// See: https://docs.k0sproject.io/stable/advanced/worker-configuration/
Args []string `json:"args,omitempty"`

// PreStartCommands specifies commands to be run before starting k0s worker.
// Commands that should be executed before the k0s worker node start.
// +kubebuilder:validation:Optional
PreStartCommands []string `json:"preStartCommands,omitempty"`

// PostStartCommands specifies commands to be run after starting k0s worker.
// Commands that should be executed after the k0s worker node start.
// +kubebuilder:validation:Optional
PostStartCommands []string `json:"postStartCommands,omitempty"`

// PreInstallK0s specifies whether k0s binary is pre-installed on the node.
// Specifies whether k0s binary is pre-installed on the node.
// +kubebuilder:validation:Optional
PreInstalledK0s bool `json:"preInstalledK0s,omitempty"`

// DownloadURL specifies the URL from which to download the k0s binary.
// If the version field is specified, it is ignored, and whatever version is downloaded from the URL is used.
// The URL from which the k0s binary should be downloaded.
// If the Version field is empty, the downloaded version of k0s is used.
// +kubebuilder:validation:Optional
DownloadURL string `json:"downloadURL,omitempty"`
}

type K0sControlPlaneMachineTemplate struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// For detais, see https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`

// InfrastructureRef is a required reference to a custom resource
// A required reference to a custom resource
// offered by an infrastructure provider.
InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`
}
Expand Down

0 comments on commit db6482a

Please sign in to comment.