fix doc of types.go of node

Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
This commit is contained in:
RuquanZhao 2022-11-22 16:59:25 +08:00
parent 57eb5d631c
commit 568fedea41
4 changed files with 31 additions and 23 deletions

View File

@ -32,10 +32,11 @@ import (
// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class/README.md // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class/README.md
type RuntimeClass struct { type RuntimeClass struct {
metav1.TypeMeta metav1.TypeMeta
// +optional // +optional
metav1.ObjectMeta metav1.ObjectMeta
// Handler specifies the underlying runtime and configuration that the CRI // handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values // implementation will use to handle pods of this class. The possible values
// are specific to the node & CRI configuration. It is assumed that all // are specific to the node & CRI configuration. It is assumed that all
// handlers are available on every node, and handlers of the same name are // handlers are available on every node, and handlers of the same name are
@ -47,13 +48,13 @@ type RuntimeClass struct {
// immutable. // immutable.
Handler string Handler string
// Overhead represents the resource overhead associated with running a pod for a // overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see // given RuntimeClass. For more details, see
// https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates // https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates
// +optional // +optional
Overhead *Overhead Overhead *Overhead
// Scheduling holds the scheduling constraints to ensure that pods running // scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it. // with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all // If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes. // nodes.
@ -63,7 +64,7 @@ type RuntimeClass struct {
// Overhead structure represents the resource overhead associated with running a pod. // Overhead structure represents the resource overhead associated with running a pod.
type Overhead struct { type Overhead struct {
// PodFixed represents the fixed resource overhead associated with running a pod. // podFixed represents the fixed resource overhead associated with running a pod.
// +optional // +optional
PodFixed core.ResourceList PodFixed core.ResourceList
} }
@ -91,9 +92,10 @@ type Scheduling struct {
// RuntimeClassList is a list of RuntimeClass objects. // RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct { type RuntimeClassList struct {
metav1.TypeMeta metav1.TypeMeta
// +optional // +optional
metav1.ListMeta metav1.ListMeta
// Items is a list of schema objects. // items is a list of schema objects.
Items []RuntimeClass Items []RuntimeClass
} }

View File

@ -34,11 +34,12 @@ import (
// https://kubernetes.io/docs/concepts/containers/runtime-class/ // https://kubernetes.io/docs/concepts/containers/runtime-class/
type RuntimeClass struct { type RuntimeClass struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Handler specifies the underlying runtime and configuration that the CRI // handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values // implementation will use to handle pods of this class. The possible values
// are specific to the node & CRI configuration. It is assumed that all // are specific to the node & CRI configuration. It is assumed that all
// handlers are available on every node, and handlers of the same name are // handlers are available on every node, and handlers of the same name are
@ -50,13 +51,13 @@ type RuntimeClass struct {
// and is immutable. // and is immutable.
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"` Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
// Overhead represents the resource overhead associated with running a pod for a // overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see // given RuntimeClass. For more details, see
// https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/ // https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
// +optional // +optional
Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"` Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"`
// Scheduling holds the scheduling constraints to ensure that pods running // scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it. // with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all // If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes. // nodes.
@ -66,7 +67,7 @@ type RuntimeClass struct {
// Overhead structure represents the resource overhead associated with running a pod. // Overhead structure represents the resource overhead associated with running a pod.
type Overhead struct { type Overhead struct {
// PodFixed represents the fixed resource overhead associated with running a pod. // podFixed represents the fixed resource overhead associated with running a pod.
// +optional // +optional
PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"`
} }
@ -96,11 +97,12 @@ type Scheduling struct {
// RuntimeClassList is a list of RuntimeClass objects. // RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct { type RuntimeClassList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// Standard list metadata. // Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects. // items is a list of schema objects.
Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"` Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"`
} }

View File

@ -34,11 +34,12 @@ import (
// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class
type RuntimeClass struct { type RuntimeClass struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Specification of the RuntimeClass // spec represents specification of the RuntimeClass
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
Spec RuntimeClassSpec `json:"spec" protobuf:"bytes,2,name=spec"` Spec RuntimeClassSpec `json:"spec" protobuf:"bytes,2,name=spec"`
} }
@ -48,7 +49,7 @@ type RuntimeClass struct {
// Interface (CRI) implementation, as well as any other components that need to // Interface (CRI) implementation, as well as any other components that need to
// understand how the pod will be run. The RuntimeClassSpec is immutable. // understand how the pod will be run. The RuntimeClassSpec is immutable.
type RuntimeClassSpec struct { type RuntimeClassSpec struct {
// RuntimeHandler specifies the underlying runtime and configuration that the // runtimeHandler specifies the underlying runtime and configuration that the
// CRI implementation will use to handle pods of this class. The possible // CRI implementation will use to handle pods of this class. The possible
// values are specific to the node & CRI configuration. It is assumed that // values are specific to the node & CRI configuration. It is assumed that
// all handlers are available on every node, and handlers of the same name are // all handlers are available on every node, and handlers of the same name are
@ -56,17 +57,17 @@ type RuntimeClassSpec struct {
// For example, a handler called "runc" might specify that the runc OCI // For example, a handler called "runc" might specify that the runc OCI
// runtime (using native Linux containers) will be used to run the containers // runtime (using native Linux containers) will be used to run the containers
// in a pod. // in a pod.
// The RuntimeHandler must be lowercase, conform to the DNS Label (RFC 1123) // The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
// requirements, and is immutable. // requirements, and is immutable.
RuntimeHandler string `json:"runtimeHandler" protobuf:"bytes,1,opt,name=runtimeHandler"` RuntimeHandler string `json:"runtimeHandler" protobuf:"bytes,1,opt,name=runtimeHandler"`
// Overhead represents the resource overhead associated with running a pod for a // overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see // given RuntimeClass. For more details, see
// https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
// +optional // +optional
Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,2,opt,name=overhead"` Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,2,opt,name=overhead"`
// Scheduling holds the scheduling constraints to ensure that pods running // scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it. // with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all // If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes. // nodes.
@ -76,7 +77,7 @@ type RuntimeClassSpec struct {
// Overhead structure represents the resource overhead associated with running a pod. // Overhead structure represents the resource overhead associated with running a pod.
type Overhead struct { type Overhead struct {
// PodFixed represents the fixed resource overhead associated with running a pod. // podFixed represents the fixed resource overhead associated with running a pod.
// +optional // +optional
PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"`
} }
@ -106,11 +107,12 @@ type Scheduling struct {
// RuntimeClassList is a list of RuntimeClass objects. // RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct { type RuntimeClassList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// Standard list metadata. // Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects. // items is a list of schema objects.
Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"` Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"`
} }

View File

@ -36,11 +36,12 @@ import (
// https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class
type RuntimeClass struct { type RuntimeClass struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Handler specifies the underlying runtime and configuration that the CRI // handler specifies the underlying runtime and configuration that the CRI
// implementation will use to handle pods of this class. The possible values // implementation will use to handle pods of this class. The possible values
// are specific to the node & CRI configuration. It is assumed that all // are specific to the node & CRI configuration. It is assumed that all
// handlers are available on every node, and handlers of the same name are // handlers are available on every node, and handlers of the same name are
@ -48,17 +49,17 @@ type RuntimeClass struct {
// For example, a handler called "runc" might specify that the runc OCI // For example, a handler called "runc" might specify that the runc OCI
// runtime (using native Linux containers) will be used to run the containers // runtime (using native Linux containers) will be used to run the containers
// in a pod. // in a pod.
// The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, // The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements,
// and is immutable. // and is immutable.
Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"` Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"`
// Overhead represents the resource overhead associated with running a pod for a // overhead represents the resource overhead associated with running a pod for a
// given RuntimeClass. For more details, see // given RuntimeClass. For more details, see
// https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
// +optional // +optional
Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"` Overhead *Overhead `json:"overhead,omitempty" protobuf:"bytes,3,opt,name=overhead"`
// Scheduling holds the scheduling constraints to ensure that pods running // scheduling holds the scheduling constraints to ensure that pods running
// with this RuntimeClass are scheduled to nodes that support it. // with this RuntimeClass are scheduled to nodes that support it.
// If scheduling is nil, this RuntimeClass is assumed to be supported by all // If scheduling is nil, this RuntimeClass is assumed to be supported by all
// nodes. // nodes.
@ -68,7 +69,7 @@ type RuntimeClass struct {
// Overhead structure represents the resource overhead associated with running a pod. // Overhead structure represents the resource overhead associated with running a pod.
type Overhead struct { type Overhead struct {
// PodFixed represents the fixed resource overhead associated with running a pod. // podFixed represents the fixed resource overhead associated with running a pod.
// +optional // +optional
PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"` PodFixed corev1.ResourceList `json:"podFixed,omitempty" protobuf:"bytes,1,opt,name=podFixed,casttype=k8s.io/api/core/v1.ResourceList,castkey=k8s.io/api/core/v1.ResourceName,castvalue=k8s.io/apimachinery/pkg/api/resource.Quantity"`
} }
@ -100,11 +101,12 @@ type Scheduling struct {
// RuntimeClassList is a list of RuntimeClass objects. // RuntimeClassList is a list of RuntimeClass objects.
type RuntimeClassList struct { type RuntimeClassList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
// Standard list metadata. // Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional // +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is a list of schema objects. // items is a list of schema objects.
Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"` Items []RuntimeClass `json:"items" protobuf:"bytes,2,rep,name=items"`
} }