mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #5073 from yujuhong/immutable
v1beta1/v1beta2: fields that cannot be updated are marked immutable
This commit is contained in:
commit
2263d86a7b
@ -53,13 +53,13 @@ type ContainerManifest struct {
|
||||
Version string `json:"version" description:"manifest version; must be v1beta1"`
|
||||
// Required: This must be a DNS_SUBDOMAIN.
|
||||
// TODO: ID on Manifest is deprecated and will be removed in the future.
|
||||
ID string `json:"id" description:"manifest name; must be a DNS_SUBDOMAIN"`
|
||||
ID string `json:"id" description:"manifest name; must be a DNS_SUBDOMAIN; cannot be updated"`
|
||||
// TODO: UUID on Manifext is deprecated in the future once we are done
|
||||
// with the API refactory. It is required for now to determine the instance
|
||||
// of a Pod.
|
||||
UUID types.UID `json:"uuid,omitempty" description:"manifest UUID, populated by the system, read-only"`
|
||||
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed"`
|
||||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
|
||||
// Optional: Set DNS policy. Defaults to "ClusterFirst"
|
||||
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
|
||||
@ -276,32 +276,32 @@ type ResourceRequirements struct {
|
||||
type Container struct {
|
||||
// Required: This must be a DNS_LABEL. Each container in a pod must
|
||||
// have a unique name.
|
||||
Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod"`
|
||||
Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated"`
|
||||
// Required.
|
||||
Image string `json:"image" description:"Docker image name"`
|
||||
// Optional: Defaults to whatever is defined in the image.
|
||||
Command []string `json:"command,omitempty" description:"command argv array; not executed within a shell; defaults to entrypoint or command in the image"`
|
||||
Command []string `json:"command,omitempty" description:"command argv array; not executed within a shell; defaults to entrypoint or command in the image; cannot be updated"`
|
||||
// Optional: Defaults to Docker's default.
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default"`
|
||||
Ports []ContainerPort `json:"ports,omitempty" description:"list of ports to expose from the container"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container"`
|
||||
Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container"`
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default; cannot be updated"`
|
||||
Ports []ContainerPort `json:"ports,omitempty" description:"list of ports to expose from the container; cannot be updated"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container; cannot be updated"`
|
||||
Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container; cannot be updated"`
|
||||
// Optional: Defaults to unlimited.
|
||||
CPU int `json:"cpu,omitempty" description:"CPU share in thousandths of a core"`
|
||||
CPU int `json:"cpu,omitempty" description:"CPU share in thousandths of a core; cannot be updated"`
|
||||
// Optional: Defaults to unlimited.
|
||||
Memory int64 `json:"memory,omitempty" description:"memory limit in bytes; defaults to unlimited"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" description:"pod volumes to mount into the container's filesystem"`
|
||||
LivenessProbe *LivenessProbe `json:"livenessProbe,omitempty" description:"periodic probe of container liveness; container will be restarted if the probe fails"`
|
||||
ReadinessProbe *LivenessProbe `json:"readinessProbe,omitempty" description:"periodic probe of container service readiness; container will be removed from service endpoints if the probe fails"`
|
||||
Lifecycle *Lifecycle `json:"lifecycle,omitempty" description:"actions that the management system should take in response to container lifecycle events"`
|
||||
Memory int64 `json:"memory,omitempty" description:"memory limit in bytes; defaults to unlimited; cannot be updated"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" description:"pod volumes to mount into the container's filesystem; cannot be updated"`
|
||||
LivenessProbe *LivenessProbe `json:"livenessProbe,omitempty" description:"periodic probe of container liveness; container will be restarted if the probe fails; cannot be updated"`
|
||||
ReadinessProbe *LivenessProbe `json:"readinessProbe,omitempty" description:"periodic probe of container service readiness; container will be removed from service endpoints if the probe fails; cannot be updated"`
|
||||
Lifecycle *Lifecycle `json:"lifecycle,omitempty" description:"actions that the management system should take in response to container lifecycle events; cannot be updated"`
|
||||
// Optional: Defaults to /dev/termination-log
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty" description:"path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log"`
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty" description:"path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"`
|
||||
// Optional: Default to false.
|
||||
Privileged bool `json:"privileged,omitempty" description:"whether or not the container is granted privileged status; defaults to false"`
|
||||
Privileged bool `json:"privileged,omitempty" description:"whether or not the container is granted privileged status; defaults to false; cannot be updated"`
|
||||
// Optional: Policy for pulling images for this container
|
||||
ImagePullPolicy PullPolicy `json:"imagePullPolicy" description:"image pull policy; one of PullAlways, PullNever, PullIfNotPresent; defaults to PullAlways if :latest tag is specified, or PullIfNotPresent otherwise"`
|
||||
ImagePullPolicy PullPolicy `json:"imagePullPolicy" description:"image pull policy; one of PullAlways, PullNever, PullIfNotPresent; defaults to PullAlways if :latest tag is specified, or PullIfNotPresent otherwise; cannot be updated"`
|
||||
// Optional: Capabilities for container.
|
||||
Capabilities Capabilities `json:"capabilities,omitempty" description:"capabilities for container"`
|
||||
Capabilities Capabilities `json:"capabilities,omitempty" description:"capabilities for container; cannot be updated"`
|
||||
}
|
||||
|
||||
// Handler defines a specific action that should be taken
|
||||
@ -333,14 +333,14 @@ type Lifecycle struct {
|
||||
|
||||
// TypeMeta is shared by all objects sent to, or returned from the client.
|
||||
type TypeMeta struct {
|
||||
Kind string `json:"kind,omitempty" description:"kind of object, in CamelCase"`
|
||||
ID string `json:"id,omitempty" description:"name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs"`
|
||||
UID types.UID `json:"uid,omitempty" description:"unique UUID across space and time; populated by the system, read-only"`
|
||||
Kind string `json:"kind,omitempty" description:"kind of object, in CamelCase; cannot be updated"`
|
||||
ID string `json:"id,omitempty" description:"name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs; cannot be updated"`
|
||||
UID types.UID `json:"uid,omitempty" description:"unique UUID across space and time; populated by the system, read-only; cannot be updated"`
|
||||
CreationTimestamp util.Time `json:"creationTimestamp,omitempty" description:"RFC 3339 date and time at which the object was created; populated by the system, read-only; null for lists"`
|
||||
SelfLink string `json:"selfLink,omitempty" description:"URL for the object; populated by the system, read-only"`
|
||||
ResourceVersion uint64 `json:"resourceVersion,omitempty" description:"string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server"`
|
||||
APIVersion string `json:"apiVersion,omitempty" description:"version of the schema the object should have"`
|
||||
Namespace string `json:"namespace,omitempty" description:"namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default"`
|
||||
Namespace string `json:"namespace,omitempty" description:"namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default; cannot be updated"`
|
||||
|
||||
// GenerateName indicates that the name should be made unique by the server prior to persisting
|
||||
// it. A non-empty value for the field indicates the name will be made unique (and the name
|
||||
@ -485,7 +485,7 @@ type PodState struct {
|
||||
Conditions []PodCondition `json:"Condition,omitempty" description:"current service state of pod"`
|
||||
// A human readable message indicating details about why the pod is in this state.
|
||||
Message string `json:"message,omitempty" description:"human readable message indicating details about why the pod is in this condition"`
|
||||
Host string `json:"host,omitempty" description:"host to which the pod is assigned; empty if not yet scheduled"`
|
||||
Host string `json:"host,omitempty" description:"host to which the pod is assigned; empty if not yet scheduled; cannot be updated"`
|
||||
HostIP string `json:"hostIP,omitempty" description:"IP address of the host to which the pod is assigned; empty if not yet scheduled"`
|
||||
PodIP string `json:"podIP,omitempty" description:"IP address allocated to the pod; routable at least within the cluster; empty if not yet allocated"`
|
||||
|
||||
@ -741,7 +741,7 @@ type Namespace struct {
|
||||
Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace"`
|
||||
|
||||
// Status describes the current status of a Namespace
|
||||
Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace"`
|
||||
Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace; read-only"`
|
||||
}
|
||||
|
||||
// NamespaceList is a list of Namespaces.
|
||||
@ -992,7 +992,7 @@ const (
|
||||
// PodSpec is a description of a pod
|
||||
type PodSpec struct {
|
||||
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed"`
|
||||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
|
||||
// Optional: Set DNS policy. Defaults to "ClusterFirst"
|
||||
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
|
||||
|
@ -235,32 +235,32 @@ type ResourceRequirements struct {
|
||||
type Container struct {
|
||||
// Required: This must be a DNS_LABEL. Each container in a pod must
|
||||
// have a unique name.
|
||||
Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod"`
|
||||
Name string `json:"name" description:"name of the container; must be a DNS_LABEL and unique within the pod; cannot be updated"`
|
||||
// Required.
|
||||
Image string `json:"image" description:"Docker image name"`
|
||||
// Optional: Defaults to whatever is defined in the image.
|
||||
Command []string `json:"command,omitempty" description:"command argv array; not executed within a shell; defaults to entrypoint or command in the image"`
|
||||
Command []string `json:"command,omitempty" description:"command argv array; not executed within a shell; defaults to entrypoint or command in the image; cannot be updated"`
|
||||
// Optional: Defaults to Docker's default.
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default"`
|
||||
Ports []ContainerPort `json:"ports,omitempty" description:"list of ports to expose from the container"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container"`
|
||||
Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container"`
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default; cannot be updated"`
|
||||
Ports []ContainerPort `json:"ports,omitempty" description:"list of ports to expose from the container; cannot be updated"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container; cannot be updated"`
|
||||
Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container; cannot be updated"`
|
||||
// Optional: Defaults to unlimited.
|
||||
CPU int `json:"cpu,omitempty" description:"CPU share in thousandths of a core"`
|
||||
CPU int `json:"cpu,omitempty" description:"CPU share in thousandths of a core; cannot be updated"`
|
||||
// Optional: Defaults to unlimited.
|
||||
Memory int64 `json:"memory,omitempty" description:"memory limit in bytes; defaults to unlimited"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" description:"pod volumes to mount into the container's filesystem"`
|
||||
LivenessProbe *LivenessProbe `json:"livenessProbe,omitempty" description:"periodic probe of container liveness; container will be restarted if the probe fails"`
|
||||
ReadinessProbe *LivenessProbe `json:"readinessProbe,omitempty" description:"periodic probe of container service readiness; container will be removed from service endpoints if the probe fails"`
|
||||
Lifecycle *Lifecycle `json:"lifecycle,omitempty" description:"actions that the management system should take in response to container lifecycle events"`
|
||||
Memory int64 `json:"memory,omitempty" description:"memory limit in bytes; defaults to unlimited; cannot be updated"`
|
||||
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" description:"pod volumes to mount into the container's filesystem; cannot be updated"`
|
||||
LivenessProbe *LivenessProbe `json:"livenessProbe,omitempty" description:"periodic probe of container liveness; container will be restarted if the probe fails; cannot be updated"`
|
||||
ReadinessProbe *LivenessProbe `json:"readinessProbe,omitempty" description:"periodic probe of container service readiness; container will be removed from service endpoints if the probe fails; cannot be updated"`
|
||||
Lifecycle *Lifecycle `json:"lifecycle,omitempty" description:"actions that the management system should take in response to container lifecycle events; cannot be updated"`
|
||||
// Optional: Defaults to /dev/termination-log
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty" description:"path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log"`
|
||||
TerminationMessagePath string `json:"terminationMessagePath,omitempty" description:"path at which the file to which the container's termination message will be written is mounted into the container's filesystem; message written is intended to be brief final status, such as an assertion failure message; defaults to /dev/termination-log; cannot be updated"`
|
||||
// Optional: Default to false.
|
||||
Privileged bool `json:"privileged,omitempty" description:"whether or not the container is granted privileged status; defaults to false"`
|
||||
Privileged bool `json:"privileged,omitempty" description:"whether or not the container is granted privileged status; defaults to false; cannot be updated"`
|
||||
// Optional: Policy for pulling images for this container
|
||||
ImagePullPolicy PullPolicy `json:"imagePullPolicy" description:"image pull policy; one of PullAlways, PullNever, PullIfNotPresent; defaults to PullAlways if :latest tag is specified, or PullIfNotPresent otherwise"`
|
||||
ImagePullPolicy PullPolicy `json:"imagePullPolicy" description:"image pull policy; one of PullAlways, PullNever, PullIfNotPresent; defaults to PullAlways if :latest tag is specified, or PullIfNotPresent otherwise; cannot be updated"`
|
||||
// Optional: Capabilities for container.
|
||||
Capabilities Capabilities `json:"capabilities,omitempty" description:"capabilities for container"`
|
||||
Capabilities Capabilities `json:"capabilities,omitempty" description:"capabilities for container; cannot be updated"`
|
||||
}
|
||||
|
||||
const (
|
||||
@ -297,14 +297,14 @@ type Lifecycle struct {
|
||||
|
||||
// TypeMeta is shared by all objects sent to, or returned from the client.
|
||||
type TypeMeta struct {
|
||||
Kind string `json:"kind,omitempty" description:"kind of object, in CamelCase"`
|
||||
ID string `json:"id,omitempty" description:"name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs"`
|
||||
Kind string `json:"kind,omitempty" description:"kind of object, in CamelCase; cannot be updated"`
|
||||
ID string `json:"id,omitempty" description:"name of the object; must be a DNS_SUBDOMAIN and unique among all objects of the same kind within the same namespace; used in resource URLs; cannot be updated"`
|
||||
UID types.UID `json:"uid,omitempty" description:"unique UUID across space and time; populated by the system, read-only"`
|
||||
CreationTimestamp util.Time `json:"creationTimestamp,omitempty" description:"RFC 3339 date and time at which the object was created; populated by the system, read-only; null for lists"`
|
||||
SelfLink string `json:"selfLink,omitempty" description:"URL for the object; populated by the system, read-only"`
|
||||
ResourceVersion uint64 `json:"resourceVersion,omitempty" description:"string that identifies the internal version of this object that can be used by clients to determine when objects have changed; populated by the system, read-only; value must be treated as opaque by clients and passed unmodified back to the server"`
|
||||
APIVersion string `json:"apiVersion,omitempty" description:"version of the schema the object should have"`
|
||||
Namespace string `json:"namespace,omitempty" description:"namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default"`
|
||||
Namespace string `json:"namespace,omitempty" description:"namespace to which the object belongs; must be a DNS_SUBDOMAIN; 'default' by default; cannot be updated"`
|
||||
|
||||
// GenerateName indicates that the name should be made unique by the server prior to persisting
|
||||
// it. A non-empty value for the field indicates the name will be made unique (and the name
|
||||
@ -449,7 +449,7 @@ type PodState struct {
|
||||
Conditions []PodCondition `json:"Condition,omitempty" description:"current service state of pod"`
|
||||
// A human readable message indicating details about why the pod is in this state.
|
||||
Message string `json:"message,omitempty" description:"human readable message indicating details about why the pod is in this condition"`
|
||||
Host string `json:"host,omitempty" description:"host to which the pod is assigned; empty if not yet scheduled"`
|
||||
Host string `json:"host,omitempty" description:"host to which the pod is assigned; empty if not yet scheduled; cannot be updated"`
|
||||
HostIP string `json:"hostIP,omitempty" description:"IP address of the host to which the pod is assigned; empty if not yet scheduled"`
|
||||
PodIP string `json:"podIP,omitempty" description:"IP address allocated to the pod; routable at least within the cluster; empty if not yet allocated"`
|
||||
|
||||
@ -702,7 +702,7 @@ type Namespace struct {
|
||||
Spec NamespaceSpec `json:"spec,omitempty" description:"spec defines the behavior of the Namespace"`
|
||||
|
||||
// Status describes the current status of a Namespace
|
||||
Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace"`
|
||||
Status NamespaceStatus `json:"status,omitempty" description:"status describes the current status of a Namespace; read-only"`
|
||||
}
|
||||
|
||||
// NamespaceList is a list of Namespaces.
|
||||
@ -957,13 +957,13 @@ type ContainerManifest struct {
|
||||
Version string `json:"version" description:"manifest version; must be v1beta1"`
|
||||
// Required: This must be a DNS_SUBDOMAIN.
|
||||
// TODO: ID on Manifest is deprecated and will be removed in the future.
|
||||
ID string `json:"id" description:"manifest name; must be a DNS_SUBDOMAIN"`
|
||||
ID string `json:"id" description:"manifest name; must be a DNS_SUBDOMAIN; cannot be updated"`
|
||||
// TODO: UUID on Manifext is deprecated in the future once we are done
|
||||
// with the API refactory. It is required for now to determine the instance
|
||||
// of a Pod.
|
||||
UUID types.UID `json:"uuid,omitempty" description:"manifest UUID"`
|
||||
UUID types.UID `json:"uuid,omitempty" description:"manifest UUID; cannot be updated"`
|
||||
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod; cannot be updated; containers cannot currently be added or removed"`
|
||||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
|
||||
// Optional: Set DNS policy. Defaults to "ClusterFirst"
|
||||
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
|
||||
@ -995,7 +995,7 @@ const (
|
||||
// PodSpec is a description of a pod
|
||||
type PodSpec struct {
|
||||
Volumes []Volume `json:"volumes" description:"list of volumes that can be mounted by containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod"`
|
||||
Containers []Container `json:"containers" description:"list of containers belonging to the pod; containers cannot currently be added or removed"`
|
||||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" description:"restart policy for all containers within the pod; one of RestartPolicyAlways, RestartPolicyOnFailure, RestartPolicyNever"`
|
||||
// Optional: Set DNS policy. Defaults to "ClusterFirst"
|
||||
DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" description:"DNS policy for containers within the pod; one of 'ClusterFirst' or 'Default'"`
|
||||
|
Loading…
Reference in New Issue
Block a user