Merge pull request #2345 from yugui/lint/api
Fixes golint errors in pkg/api.
This commit is contained in:
@@ -136,8 +136,9 @@ type Volume struct {
|
||||
Source *VolumeSource `json:"source" yaml:"source"`
|
||||
}
|
||||
|
||||
// VolumeSource represents the source location of a valume to mount.
|
||||
// Only one of its members may be specified.
|
||||
type VolumeSource struct {
|
||||
// Only one of the following sources may be specified
|
||||
// HostDir represents a pre-existing directory on the host machine that is directly
|
||||
// exposed to the container. This is generally used for system agents or other privileged
|
||||
// things that are allowed to see the host machine. Most containers will NOT need this.
|
||||
@@ -170,7 +171,8 @@ const (
|
||||
ProtocolUDP Protocol = "UDP"
|
||||
)
|
||||
|
||||
// GCEPersistent Disk resource.
|
||||
// GCEPersistentDisk represents a Persistent Disk resource in Google Compute Engine.
|
||||
//
|
||||
// A GCE PD must exist and be formatted before mounting to a container.
|
||||
// The disk must also be in the same GCE project and zone as the kubelet.
|
||||
// A GCE PD can only be mounted as read/write once.
|
||||
@@ -275,11 +277,11 @@ type LivenessProbe struct {
|
||||
type PullPolicy string
|
||||
|
||||
const (
|
||||
// Always attempt to pull the latest image. Container will fail If the pull fails.
|
||||
// PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.
|
||||
PullAlways PullPolicy = "PullAlways"
|
||||
// Never pull an image, only use a local image. Container will fail if the image isn't present
|
||||
// PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present
|
||||
PullNever PullPolicy = "PullNever"
|
||||
// Pull if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
|
||||
// PullIfNotPresent means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.
|
||||
PullIfNotPresent PullPolicy = "PullIfNotPresent"
|
||||
)
|
||||
|
||||
@@ -373,9 +375,10 @@ type ContainerStateTerminated struct {
|
||||
FinishedAt time.Time `json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerState holds a possible state of container.
|
||||
// Only one of its members may be specified.
|
||||
// If none of them is specified, the default one is ContainerStateWaiting.
|
||||
type ContainerState struct {
|
||||
// Only one of the following ContainerState may be specified.
|
||||
// If none of them is specified, the default one is ContainerStateWaiting.
|
||||
Waiting *ContainerStateWaiting `json:"waiting,omitempty" yaml:"waiting,omitempty"`
|
||||
Running *ContainerStateRunning `json:"running,omitempty" yaml:"running,omitempty"`
|
||||
Termination *ContainerStateTerminated `json:"termination,omitempty" yaml:"termination,omitempty"`
|
||||
@@ -406,10 +409,11 @@ type RestartPolicyOnFailure struct{}
|
||||
|
||||
type RestartPolicyNever struct{}
|
||||
|
||||
// RestartPolicy describes how the container should be restarted.
|
||||
// Only one of the following restart policies may be specified.
|
||||
// If none of the following policies is specified, the default one
|
||||
// is RestartPolicyAlways.
|
||||
type RestartPolicy struct {
|
||||
// Only one of the following restart policies may be specified.
|
||||
// If none of the following policies is specified, the default one
|
||||
// is RestartPolicyAlways.
|
||||
Always *RestartPolicyAlways `json:"always,omitempty" yaml:"always,omitempty"`
|
||||
OnFailure *RestartPolicyOnFailure `json:"onFailure,omitempty" yaml:"onFailure,omitempty"`
|
||||
Never *RestartPolicyNever `json:"never,omitempty" yaml:"never,omitempty"`
|
||||
@@ -808,7 +812,7 @@ const (
|
||||
// CauseTypeFieldValueNotFound is used to report failure to find a requested value
|
||||
// (e.g. looking up an ID).
|
||||
CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound"
|
||||
// CauseTypeFieldValueInvalid is used to report required values that are not
|
||||
// CauseTypeFieldValueRequired is used to report required values that are not
|
||||
// provided (e.g. empty strings, null values, or empty arrays).
|
||||
CauseTypeFieldValueRequired CauseType = "FieldValueRequired"
|
||||
// CauseTypeFieldValueDuplicate is used to report collisions of values that must be
|
||||
|
Reference in New Issue
Block a user