Convert remaining int types to fixed

Having internal and external integer types being different hides potential conversion problems. Propagate that out further (which will also allow us to better optimize conversion).
parent 87148737
......@@ -456,7 +456,7 @@ type GCEPersistentDiskVolumeSource struct {
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field is 0 or empty.
Partition int `json:"partition,omitempty"`
Partition int32 `json:"partition,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
ReadOnly bool `json:"readOnly,omitempty"`
......@@ -472,7 +472,7 @@ type ISCSIVolumeSource struct {
// Required: target iSCSI Qualified Name
IQN string `json:"iqn,omitempty"`
// Required: iSCSI target lun number
Lun int `json:"lun,omitempty"`
Lun int32 `json:"lun,omitempty"`
// Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport.
ISCSIInterface string `json:"iscsiInterface,omitempty"`
// Filesystem type to mount.
......@@ -492,7 +492,7 @@ type FCVolumeSource struct {
// Required: FC target world wide names (WWNs)
TargetWWNs []string `json:"targetWWNs"`
// Required: FC target lun number
Lun *int `json:"lun"`
Lun *int32 `json:"lun"`
// Filesystem type to mount.
// Must be a filesystem type supported by the host operating system.
// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
......@@ -542,7 +542,7 @@ type AWSElasticBlockStoreVolumeSource struct {
// Optional: Partition on the disk to mount.
// If omitted, kubelet will attempt to mount the device name.
// Ex. For /dev/sda1, this field is "1", for /dev/sda, this field is 0 or empty.
Partition int `json:"partition,omitempty"`
Partition int32 `json:"partition,omitempty"`
// Optional: Defaults to false (read/write). ReadOnly here will force
// the ReadOnly setting in VolumeMounts.
ReadOnly bool `json:"readOnly,omitempty"`
......@@ -731,9 +731,9 @@ type ContainerPort struct {
Name string `json:"name,omitempty"`
// Optional: If specified, this must be a valid port number, 0 < x < 65536.
// If HostNetwork is specified, this must match ContainerPort.
HostPort int `json:"hostPort,omitempty"`
HostPort int32 `json:"hostPort,omitempty"`
// Required: This must be a valid port number, 0 < x < 65536.
ContainerPort int `json:"containerPort"`
ContainerPort int32 `json:"containerPort"`
// Required: Supports "TCP" and "UDP".
Protocol Protocol `json:"protocol,omitempty"`
// Optional: What host IP to bind the external port to.
......@@ -858,16 +858,16 @@ type Probe struct {
// The action taken to determine the health of a container
Handler `json:",inline"`
// Length of time before health checking is activated. In seconds.
InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"`
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
// Length of time before health checking times out. In seconds.
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
// How often (in seconds) to perform the probe.
PeriodSeconds int `json:"periodSeconds,omitempty"`
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
// Minimum consecutive successes for the probe to be considered successful after having failed.
// Must be 1 for liveness.
SuccessThreshold int `json:"successThreshold,omitempty"`
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
FailureThreshold int `json:"failureThreshold,omitempty"`
FailureThreshold int32 `json:"failureThreshold,omitempty"`
}
// PullPolicy describes a policy for if/when to pull a container image
......@@ -998,8 +998,8 @@ type ContainerStateRunning struct {
}
type ContainerStateTerminated struct {
ExitCode int `json:"exitCode"`
Signal int `json:"signal,omitempty"`
ExitCode int32 `json:"exitCode"`
Signal int32 `json:"signal,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
StartedAt unversioned.Time `json:"startedAt,omitempty"`
......@@ -1025,7 +1025,7 @@ type ContainerStatus struct {
Ready bool `json:"ready"`
// Note that this is calculated from dead containers. But those containers are subject to
// garbage collection. This value will get capped at 5 by GC.
RestartCount int `json:"restartCount"`
RestartCount int32 `json:"restartCount"`
Image string `json:"image"`
ImageID string `json:"imageID"`
ContainerID string `json:"containerID,omitempty"`
......@@ -1188,7 +1188,7 @@ type NodeAffinity struct {
// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
type PreferredSchedulingTerm struct {
// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
Weight int `json:"weight"`
Weight int32 `json:"weight"`
// A node selector term, associated with the corresponding weight.
Preference NodeSelectorTerm `json:"preference"`
}
......@@ -1368,7 +1368,7 @@ type PodTemplateList struct {
// a TemplateRef or a Template set.
type ReplicationControllerSpec struct {
// Replicas is the number of desired replicas.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// Selector is a label query over pods that should match the Replicas count.
Selector map[string]string `json:"selector"`
......@@ -1388,10 +1388,10 @@ type ReplicationControllerSpec struct {
// controller.
type ReplicationControllerStatus struct {
// Replicas is the number of actual replicas.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// The number of pods that have labels matching the labels of the pod template of the replication controller.
FullyLabeledReplicas int `json:"fullyLabeledReplicas,omitempty"`
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
// ObservedGeneration is the most recent generation observed by the controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
......@@ -1535,7 +1535,7 @@ type ServicePort struct {
Protocol Protocol `json:"protocol"`
// The port that will be exposed on the service.
Port int `json:"port"`
Port int32 `json:"port"`
// Optional: The target port on pods selected by this service. If this
// is a string, it will be looked up as a named port in the target
......@@ -1547,7 +1547,7 @@ type ServicePort struct {
// The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort"`
NodePort int32 `json:"nodePort"`
}
// +genclient=true
......@@ -1652,7 +1652,7 @@ type EndpointPort struct {
Name string
// The port number.
Port int
Port int32
// The IP protocol for this port.
Protocol Protocol
......@@ -1692,7 +1692,7 @@ type DaemonEndpoint struct {
*/
// Port number of the given endpoint.
Port int `json:"Port"`
Port int32 `json:"Port"`
}
// NodeDaemonEndpoints lists ports opened by daemons running on the Node.
......@@ -2134,7 +2134,7 @@ type Event struct {
LastTimestamp unversioned.Time `json:"lastTimestamp,omitempty"`
// The number of times this event has occurred.
Count int `json:"count,omitempty"`
Count int32 `json:"count,omitempty"`
// Type of this event (Normal, Warning), new types could be added in the future.
Type string `json:"type,omitempty"`
......
......@@ -37,13 +37,13 @@ type Scale struct {
// ScaleSpec describes the attributes of a scale subresource.
type ScaleSpec struct {
// desired number of instances for the scaled object.
Replicas int `json:"replicas,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
}
// ScaleStatus represents the current status of a scale subresource.
type ScaleStatus struct {
// actual number of observed instances of the scaled object.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// label query over pods that should match the replicas count. This is same
// as the label selector but in the string format to avoid introspection
......
......@@ -57,14 +57,14 @@ type JobSpec struct {
// run at any given time. The actual number of pods running in steady state will
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
Parallelism *int `json:"parallelism,omitempty"`
Parallelism *int32 `json:"parallelism,omitempty"`
// Completions specifies the desired number of successfully finished pods the
// job should be run with. Setting to nil means that the success of any
// pod signals the success of all pods, and allows parallelism to have any positive
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
Completions *int `json:"completions,omitempty"`
Completions *int32 `json:"completions,omitempty"`
// Optional duration in seconds relative to the startTime that the job may be active
// before the system tries to terminate it; value must be positive integer
......@@ -107,13 +107,13 @@ type JobStatus struct {
CompletionTime *unversioned.Time `json:"completionTime,omitempty"`
// Active is the number of actively running pods.
Active int `json:"active,omitempty"`
Active int32 `json:"active,omitempty"`
// Succeeded is the number of pods which reached Phase Succeeded.
Succeeded int `json:"succeeded,omitempty"`
Succeeded int32 `json:"succeeded,omitempty"`
// Failed is the number of pods which reached Phase Failed.
Failed int `json:"failed,omitempty"`
Failed int32 `json:"failed,omitempty"`
}
type JobConditionType string
......
......@@ -38,13 +38,13 @@ import (
// describes the attributes of a scale subresource
type ScaleSpec struct {
// desired number of instances for the scaled object.
Replicas int `json:"replicas,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
}
// represents the current status of a scale subresource.
type ScaleStatus struct {
// actual number of observed instances of the scaled object.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// label query over pods that should match the replicas count.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors
......@@ -86,7 +86,7 @@ type SubresourceReference struct {
type CPUTargetUtilization struct {
// fraction of the requested CPU that should be utilized/used,
// e.g. 70 means that 70% of the requested CPU should be in use.
TargetPercentage int `json:"targetPercentage"`
TargetPercentage int32 `json:"targetPercentage"`
}
// Alpha-level support for Custom Metrics in HPA (as annotations).
......@@ -118,9 +118,9 @@ type HorizontalPodAutoscalerSpec struct {
// and will set the desired number of pods by modifying its spec.
ScaleRef SubresourceReference `json:"scaleRef"`
// lower limit for the number of pods that can be set by the autoscaler, default 1.
MinReplicas *int `json:"minReplicas,omitempty"`
MinReplicas *int32 `json:"minReplicas,omitempty"`
// upper limit for the number of pods that can be set by the autoscaler. It cannot be smaller than MinReplicas.
MaxReplicas int `json:"maxReplicas"`
MaxReplicas int32 `json:"maxReplicas"`
// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
// if not specified it defaults to the target CPU utilization at 80% of the requested resources.
CPUUtilization *CPUTargetUtilization `json:"cpuUtilization,omitempty"`
......@@ -136,14 +136,14 @@ type HorizontalPodAutoscalerStatus struct {
LastScaleTime *unversioned.Time `json:"lastScaleTime,omitempty"`
// current number of replicas of pods managed by this autoscaler.
CurrentReplicas int `json:"currentReplicas"`
CurrentReplicas int32 `json:"currentReplicas"`
// desired number of replicas of pods managed by this autoscaler.
DesiredReplicas int `json:"desiredReplicas"`
DesiredReplicas int32 `json:"desiredReplicas"`
// current average CPU utilization over all pods, represented as a percentage of requested CPU,
// e.g. 70 means that an average pod is using now 70% of its requested CPU.
CurrentCPUUtilizationPercentage *int `json:"currentCPUUtilizationPercentage,omitempty"`
CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"`
}
// +genclient=true
......@@ -229,7 +229,7 @@ type Deployment struct {
type DeploymentSpec struct {
// Number of desired pods. This is a pointer to distinguish between explicit
// zero and not specified. Defaults to 1.
Replicas int `json:"replicas,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
// Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment.
......@@ -244,11 +244,11 @@ type DeploymentSpec struct {
// Minimum number of seconds for which a newly created pod should be ready
// without any of its container crashing, for it to be considered available.
// Defaults to 0 (pod will be considered available as soon as it is ready)
MinReadySeconds int `json:"minReadySeconds,omitempty"`
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// The number of old ReplicaSets to retain to allow rollback.
// This is a pointer to distinguish between explicit zero and not specified.
RevisionHistoryLimit *int `json:"revisionHistoryLimit,omitempty"`
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
// Indicates that the deployment is paused and will not be processed by the
// deployment controller.
......@@ -334,16 +334,16 @@ type DeploymentStatus struct {
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
Replicas int `json:"replicas,omitempty"`
Replicas int32 `json:"replicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
UpdatedReplicas int `json:"updatedReplicas,omitempty"`
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
AvailableReplicas int `json:"availableReplicas,omitempty"`
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// Total number of unavailable pods targeted by this deployment.
UnavailableReplicas int `json:"unavailableReplicas,omitempty"`
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`
}
type DeploymentList struct {
......@@ -442,15 +442,15 @@ const (
type DaemonSetStatus struct {
// CurrentNumberScheduled is the number of nodes that are running at least 1
// daemon pod and are supposed to run the daemon pod.
CurrentNumberScheduled int `json:"currentNumberScheduled"`
CurrentNumberScheduled int32 `json:"currentNumberScheduled"`
// NumberMisscheduled is the number of nodes that are running the daemon pod, but are
// not supposed to run the daemon pod.
NumberMisscheduled int `json:"numberMisscheduled"`
NumberMisscheduled int32 `json:"numberMisscheduled"`
// DesiredNumberScheduled is the total number of nodes that should be running the daemon
// pod (including nodes correctly running the daemon pod).
DesiredNumberScheduled int `json:"desiredNumberScheduled"`
DesiredNumberScheduled int32 `json:"desiredNumberScheduled"`
}
// +genclient=true
......@@ -674,7 +674,7 @@ type ReplicaSetList struct {
// a Template set.
type ReplicaSetSpec struct {
// Replicas is the number of desired replicas.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// Selector is a label query over pods that should match the replica count.
// Must match in order to be controlled.
......@@ -690,10 +690,10 @@ type ReplicaSetSpec struct {
// ReplicaSetStatus represents the current status of a ReplicaSet.
type ReplicaSetStatus struct {
// Replicas is the number of actual replicas.
Replicas int `json:"replicas"`
Replicas int32 `json:"replicas"`
// The number of pods that have labels matching the labels of the pod template of the replicaset.
FullyLabeledReplicas int `json:"fullyLabeledReplicas,omitempty"`
FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`
// ObservedGeneration is the most recent generation observed by the controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment