Fix golint errors in pkg/apis/core (#82919)

* Fix lint errors related to receiver name

Ref #68026

* Fix lint errors related to comments

Ref #68026

* Fix package name in comments

Ref #68026

* Rename Cpu to CPU

Ref #68026

* Fix lint errors related to naming convention

Ref #68026

* Remove deprecated field

DoNotUse_ExternalID has been deprecated and is not in use anymore.
It has been removed to fix lint errors related to underscores in field
names.

Ref #68026, #61966

* Include pkg/apis/core in golint check

Ref #68026

* Rename var to fix lint errors

Ref #68026

* Revert "Remove deprecated field"

This reverts commit 75e9bfc168077fcb9346e334b59d60a2c997735b.

Ref #82919

* Remove math from godoc

Ref #82919, #68026

* Remove underscore from var name

Ref #68026

* Rename var in staging core api type

Ref #68026
This commit is contained in:
Mahendra Kariya 2019-09-25 23:36:51 +05:30 committed by Kubernetes Prow Robot
parent 0b4cccc9d1
commit 3698100224
16 changed files with 1052 additions and 971 deletions

View File

@ -505,7 +505,7 @@ API rule violation: names_match,k8s.io/api/core/v1,ISCSIPersistentVolumeSource,S
API rule violation: names_match,k8s.io/api/core/v1,ISCSIVolumeSource,DiscoveryCHAPAuth
API rule violation: names_match,k8s.io/api/core/v1,ISCSIVolumeSource,SessionCHAPAuth
API rule violation: names_match,k8s.io/api/core/v1,NodeResources,Capacity
API rule violation: names_match,k8s.io/api/core/v1,NodeSpec,DoNotUse_ExternalID
API rule violation: names_match,k8s.io/api/core/v1,NodeSpec,DoNotUseExternalID
API rule violation: names_match,k8s.io/api/core/v1,PersistentVolumeSource,CephFS
API rule violation: names_match,k8s.io/api/core/v1,PersistentVolumeSource,StorageOS
API rule violation: names_match,k8s.io/api/core/v1,PodSpec,DeprecatedServiceAccount

View File

@ -25,7 +25,6 @@ pkg/apis/batch/validation
pkg/apis/certificates
pkg/apis/certificates/v1beta1
pkg/apis/certificates/validation
pkg/apis/core
pkg/apis/core/helper/qos
pkg/apis/core/v1
pkg/apis/core/v1/helper

View File

@ -26,7 +26,7 @@ const (
// PodPresetOptOutAnnotationKey represents the annotation key for a pod to exempt itself from pod preset manipulation
PodPresetOptOutAnnotationKey string = "podpreset.admission.kubernetes.io/exclude"
// MirrorAnnotationKey represents the annotation key set by kubelets when creating mirror pods
// MirrorPodAnnotationKey represents the annotation key set by kubelets when creating mirror pods
MirrorPodAnnotationKey string = "kubernetes.io/config.mirror"
// TolerationsAnnotationKey represents the key of tolerations data (json serialized)
@ -56,7 +56,7 @@ const (
// in the Annotations of a Node.
PreferAvoidPodsAnnotationKey string = "scheduler.alpha.kubernetes.io/preferAvoidPods"
// ObjectTTLAnnotations represents a suggestion for kubelet for how long it can cache
// ObjectTTLAnnotationKey represents a suggestion for kubelet for how long it can cache
// an object (e.g. secret, config map) before fetching it again from apiserver.
// This annotation can be attached to node.
ObjectTTLAnnotationKey string = "node.alpha.kubernetes.io/ttl"
@ -65,7 +65,7 @@ const (
// the kubelet prior to running
BootstrapCheckpointAnnotationKey string = "node.kubernetes.io/bootstrap-checkpoint"
// annotation key prefix used to identify non-convertible json paths.
// NonConvertibleAnnotationPrefix annotation key prefix used to identify non-convertible json paths.
NonConvertibleAnnotationPrefix = "non-convertible.kubernetes.io"
kubectlPrefix = "kubectl.kubernetes.io/"

View File

@ -16,7 +16,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// Package api contains the latest (or "internal") version of the
// Package core contains the latest (or "internal") version of the
// Kubernetes API objects. This is the API objects as represented in memory.
// The contract presented to clients is located in the versioned packages,
// which are sub-directories. The first one is "v1". Those packages

View File

@ -24,5 +24,8 @@ import "encoding/json"
var _ = json.Marshaler(&AvoidPods{})
var _ = json.Unmarshaler(&AvoidPods{})
// MarshalJSON panics to prevent marshalling of internal structs
func (AvoidPods) MarshalJSON() ([]byte, error) { panic("do not marshal internal struct") }
func (*AvoidPods) UnmarshalJSON([]byte) error { panic("do not unmarshal to internal struct") }
// UnmarshalJSON panics to prevent unmarshalling of internal structs
func (*AvoidPods) UnmarshalJSON([]byte) error { panic("do not unmarshal to internal struct") }

View File

@ -23,12 +23,15 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)
// SetGroupVersionKind sets the API version and kind of the object reference
func (obj *ObjectReference) SetGroupVersionKind(gvk schema.GroupVersionKind) {
obj.APIVersion, obj.Kind = gvk.ToAPIVersionAndKind()
}
// GroupVersionKind returns the API version and kind of the object reference
func (obj *ObjectReference) GroupVersionKind() schema.GroupVersionKind {
return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
}
// GetObjectKind returns the kind of object reference
func (obj *ObjectReference) GetObjectKind() schema.ObjectKind { return obj }

View File

@ -39,8 +39,12 @@ func Resource(resource string) schema.GroupResource {
}
var (
// SchemeBuilder object to register various known types
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
// AddToScheme represents a func that can be used to apply all the registered
// funcs in a scheme
AddToScheme = SchemeBuilder.AddToScheme
)
func addKnownTypes(scheme *runtime.Scheme) error {

View File

@ -20,35 +20,37 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
)
func (self ResourceName) String() string {
return string(self)
func (rn ResourceName) String() string {
return string(rn)
}
// Returns the CPU limit if specified.
func (self *ResourceList) Cpu() *resource.Quantity {
if val, ok := (*self)[ResourceCPU]; ok {
// CPU returns the CPU limit if specified.
func (rl *ResourceList) CPU() *resource.Quantity {
if val, ok := (*rl)[ResourceCPU]; ok {
return &val
}
return &resource.Quantity{Format: resource.DecimalSI}
}
// Returns the Memory limit if specified.
func (self *ResourceList) Memory() *resource.Quantity {
if val, ok := (*self)[ResourceMemory]; ok {
// Memory returns the Memory limit if specified.
func (rl *ResourceList) Memory() *resource.Quantity {
if val, ok := (*rl)[ResourceMemory]; ok {
return &val
}
return &resource.Quantity{Format: resource.BinarySI}
}
func (self *ResourceList) Pods() *resource.Quantity {
if val, ok := (*self)[ResourcePods]; ok {
// Pods returns the list of pods
func (rl *ResourceList) Pods() *resource.Quantity {
if val, ok := (*rl)[ResourcePods]; ok {
return &val
}
return &resource.Quantity{}
}
func (self *ResourceList) StorageEphemeral() *resource.Quantity {
if val, ok := (*self)[ResourceEphemeralStorage]; ok {
// StorageEphemeral returns the list of ephemeral storage volumes, if any
func (rl *ResourceList) StorageEphemeral() *resource.Quantity {
if val, ok := (*rl)[ResourceEphemeralStorage]; ok {
return &val
}
return &resource.Quantity{}

View File

@ -27,7 +27,7 @@ func (t *Taint) MatchTaint(taintToMatch Taint) bool {
return t.Key == taintToMatch.Key && t.Effect == taintToMatch.Effect
}
// taint.ToString() converts taint struct to string in format '<key>=<value>:<effect>', '<key>=<value>:', '<key>:<effect>', or '<key>'.
// ToString converts taint struct to string in format '<key>=<value>:<effect>', '<key>=<value>:', '<key>:<effect>', or '<key>'.
func (t *Taint) ToString() string {
if len(t.Effect) == 0 {
if len(t.Value) == 0 {

View File

@ -159,7 +159,7 @@ type VolumeSource struct {
CSI *CSIVolumeSource
}
// Similar to VolumeSource but meant for the administrator who creates PVs.
// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs.
// Exactly one of its members must be set.
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
@ -237,6 +237,7 @@ type PersistentVolumeSource struct {
CSI *CSIPersistentVolumeSource
}
// PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace
type PersistentVolumeClaimVolumeSource struct {
// ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume
ClaimName string
@ -257,6 +258,7 @@ const (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PersistentVolume struct captures the details of the implementation of PV storage
type PersistentVolume struct {
metav1.TypeMeta
// +optional
@ -271,6 +273,7 @@ type PersistentVolume struct {
Status PersistentVolumeStatus
}
// PersistentVolumeSpec has most of the details required to define a persistent volume
type PersistentVolumeSpec struct {
// Resources represents the actual resources of the volume
Capacity ResourceList
@ -340,6 +343,7 @@ const (
PersistentVolumeFilesystem PersistentVolumeMode = "Filesystem"
)
// PersistentVolumeStatus represents the status of PV storage
type PersistentVolumeStatus struct {
// Phase indicates if a volume is available, bound to a claim, or released by a claim
// +optional
@ -354,6 +358,7 @@ type PersistentVolumeStatus struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PersistentVolumeList represents a list of PVs
type PersistentVolumeList struct {
metav1.TypeMeta
// +optional
@ -380,6 +385,7 @@ type PersistentVolumeClaim struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PersistentVolumeClaimList represents the list of PV claims
type PersistentVolumeClaimList struct {
metav1.TypeMeta
// +optional
@ -428,6 +434,8 @@ type PersistentVolumeClaimSpec struct {
DataSource *TypedLocalObjectReference
}
// PersistentVolumeClaimConditionType defines the condition of PV claim.
// Valid values are either "Resizing" or "FileSystemResizePending".
type PersistentVolumeClaimConditionType string
// These are valid conditions of Pvc
@ -438,6 +446,7 @@ const (
PersistentVolumeClaimFileSystemResizePending PersistentVolumeClaimConditionType = "FileSystemResizePending"
)
// PersistentVolumeClaimCondition represents the current condition of PV claim
type PersistentVolumeClaimCondition struct {
Type PersistentVolumeClaimConditionType
Status ConditionStatus
@ -451,6 +460,7 @@ type PersistentVolumeClaimCondition struct {
Message string
}
// PersistentVolumeClaimStatus represents the status of PV claim
type PersistentVolumeClaimStatus struct {
// Phase represents the current phase of PersistentVolumeClaim
// +optional
@ -465,8 +475,10 @@ type PersistentVolumeClaimStatus struct {
Conditions []PersistentVolumeClaimCondition
}
// PersistentVolumeAccessMode defines various access modes for PV.
type PersistentVolumeAccessMode string
// These are the valid values for PersistentVolumeAccessMode
const (
// can be mounted read/write mode to exactly 1 host
ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce"
@ -476,8 +488,10 @@ const (
ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany"
)
// PersistentVolumePhase defines the phase in which a PV is
type PersistentVolumePhase string
// These are the valid values for PersistentVolumePhase
const (
// used for PersistentVolumes that are not available
VolumePending PersistentVolumePhase = "Pending"
@ -494,8 +508,10 @@ const (
VolumeFailed PersistentVolumePhase = "Failed"
)
// PersistentVolumeClaimPhase defines the phase of PV claim
type PersistentVolumeClaimPhase string
// These are the valid value for PersistentVolumeClaimPhase
const (
// used for PersistentVolumeClaims that are not yet bound
ClaimPending PersistentVolumeClaimPhase = "Pending"
@ -507,8 +523,10 @@ const (
ClaimLost PersistentVolumeClaimPhase = "Lost"
)
// HostPathType defines the type of host path for PV
type HostPathType string
// These are the valid values for HostPathType
const (
// For backwards compatible, leave it empty if unset
HostPathUnset HostPathType = ""
@ -530,7 +548,7 @@ const (
HostPathBlockDev HostPathType = "BlockDevice"
)
// Represents a host path mapped into a pod.
// HostPathVolumeSource represents a host path mapped into a pod.
// Host path volumes do not support ownership management or SELinux relabeling.
type HostPathVolumeSource struct {
// If the path is a symlink, it will follow the link to the real path.
@ -539,7 +557,7 @@ type HostPathVolumeSource struct {
Type *HostPathType
}
// Represents an empty directory for a pod.
// EmptyDirVolumeSource represents an empty directory for a pod.
// Empty directory volumes support ownership management and SELinux relabeling.
type EmptyDirVolumeSource struct {
// TODO: Longer term we want to represent the selection of underlying
@ -563,6 +581,7 @@ type EmptyDirVolumeSource struct {
// StorageMedium defines ways that storage can be allocated to a volume.
type StorageMedium string
// These are the valid value for StorageMedium
const (
StorageMediumDefault StorageMedium = "" // use whatever the default is for the node
StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs)
@ -581,7 +600,7 @@ const (
ProtocolSCTP Protocol = "SCTP"
)
// Represents a Persistent Disk resource in Google Compute Engine.
// GCEPersistentDiskVolumeSource represents a Persistent Disk resource in Google Compute Engine.
//
// A GCE PD must exist before mounting to a container. The disk must
// also be in the same GCE project and zone as the kubelet. A GCE PD
@ -607,7 +626,7 @@ type GCEPersistentDiskVolumeSource struct {
ReadOnly bool
}
// Represents an ISCSI disk.
// ISCSIVolumeSource represents an ISCSI disk.
// ISCSI volumes can only be mounted as read/write once.
// ISCSI volumes support ownership management and SELinux relabeling.
type ISCSIVolumeSource struct {
@ -703,7 +722,7 @@ type ISCSIPersistentVolumeSource struct {
InitiatorName *string
}
// Represents a Fibre Channel volume.
// FCVolumeSource represents a Fibre Channel volume.
// Fibre Channel volumes can only be mounted as read/write once.
// Fibre Channel volumes support ownership management and SELinux relabeling.
type FCVolumeSource struct {
@ -755,7 +774,7 @@ type FlexPersistentVolumeSource struct {
Options map[string]string
}
// FlexVolume represents a generic volume resource that is
// FlexVolumeSource represents a generic volume resource that is
// provisioned/attached using an exec based plugin.
type FlexVolumeSource struct {
// Driver is the name of the driver to use for this volume.
@ -781,7 +800,7 @@ type FlexVolumeSource struct {
Options map[string]string
}
// Represents a Persistent Disk resource in AWS.
// AWSElasticBlockStoreVolumeSource represents a Persistent Disk resource in AWS.
//
// An AWS EBS disk must exist before mounting to a container. The disk
// must also be in the same AWS zone as the kubelet. An AWS EBS disk
@ -807,7 +826,7 @@ type AWSElasticBlockStoreVolumeSource struct {
ReadOnly bool
}
// Represents a volume that is populated with the contents of a git repository.
// GitRepoVolumeSource represents a volume that is populated with the contents of a git repository.
// Git repo volumes do not support ownership management.
// Git repo volumes support SELinux relabeling.
//
@ -829,7 +848,7 @@ type GitRepoVolumeSource struct {
// TODO: Consider credentials here.
}
// Adapts a Secret into a volume.
// SecretVolumeSource adapts a Secret into a volume.
//
// The contents of the target Secret's Data field will be presented in a volume
// as files using the keys in the Data field as the file names.
@ -859,7 +878,7 @@ type SecretVolumeSource struct {
Optional *bool
}
// Adapts a secret into a projected volume.
// SecretProjection adapts a secret into a projected volume.
//
// The contents of the target Secret's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names.
@ -881,7 +900,7 @@ type SecretProjection struct {
Optional *bool
}
// Represents an NFS mount that lasts the lifetime of a pod.
// NFSVolumeSource represents an NFS mount that lasts the lifetime of a pod.
// NFS volumes do not support ownership management or SELinux relabeling.
type NFSVolumeSource struct {
// Server is the hostname or IP address of the NFS server
@ -896,7 +915,7 @@ type NFSVolumeSource struct {
ReadOnly bool
}
// Represents a Quobyte mount that lasts the lifetime of a pod.
// QuobyteVolumeSource represents a Quobyte mount that lasts the lifetime of a pod.
// Quobyte volumes do not support ownership management or SELinux relabeling.
type QuobyteVolumeSource struct {
// Registry represents a single or multiple Quobyte Registry services
@ -928,7 +947,7 @@ type QuobyteVolumeSource struct {
Tenant string
}
// Represents a Glusterfs mount that lasts the lifetime of a pod.
// GlusterfsVolumeSource represents a Glusterfs mount that lasts the lifetime of a pod.
// Glusterfs volumes do not support ownership management or SELinux relabeling.
type GlusterfsVolumeSource struct {
// Required: EndpointsName is the endpoint name that details Glusterfs topology
@ -943,7 +962,7 @@ type GlusterfsVolumeSource struct {
ReadOnly bool
}
// Represents a Glusterfs mount that lasts the lifetime of a pod.
// GlusterfsPersistentVolumeSource represents a Glusterfs mount that lasts the lifetime of a pod.
// Glusterfs volumes do not support ownership management or SELinux relabeling.
type GlusterfsPersistentVolumeSource struct {
// EndpointsName is the endpoint name that details Glusterfs topology.
@ -967,7 +986,7 @@ type GlusterfsPersistentVolumeSource struct {
EndpointsNamespace *string
}
// Represents a Rados Block Device mount that lasts the lifetime of a pod.
// RBDVolumeSource represents a Rados Block Device mount that lasts the lifetime of a pod.
// RBD volumes support ownership management and SELinux relabeling.
type RBDVolumeSource struct {
// Required: CephMonitors is a collection of Ceph monitors
@ -998,7 +1017,7 @@ type RBDVolumeSource struct {
ReadOnly bool
}
// Represents a Rados Block Device mount that lasts the lifetime of a pod.
// RBDPersistentVolumeSource represents a Rados Block Device mount that lasts the lifetime of a pod.
// RBD volumes support ownership management and SELinux relabeling.
type RBDPersistentVolumeSource struct {
// Required: CephMonitors is a collection of Ceph monitors
@ -1029,7 +1048,7 @@ type RBDPersistentVolumeSource struct {
ReadOnly bool
}
// Represents a cinder volume resource in Openstack. A Cinder volume
// CinderVolumeSource represents a cinder volume resource in Openstack. A Cinder volume
// must exist before mounting to a container. The volume must also be
// in the same region as the kubelet. Cinder volumes support ownership
// management and SELinux relabeling.
@ -1051,7 +1070,7 @@ type CinderVolumeSource struct {
SecretRef *LocalObjectReference
}
// Represents a cinder volume resource in Openstack. A Cinder volume
// CinderPersistentVolumeSource represents a cinder volume resource in Openstack. A Cinder volume
// must exist before mounting to a container. The volume must also be
// in the same region as the kubelet. Cinder volumes support ownership
// management and SELinux relabeling.
@ -1073,7 +1092,7 @@ type CinderPersistentVolumeSource struct {
SecretRef *SecretReference
}
// Represents a Ceph Filesystem mount that lasts the lifetime of a pod
// CephFSVolumeSource represents a Ceph Filesystem mount that lasts the lifetime of a pod
// Cephfs volumes do not support ownership management or SELinux relabeling.
type CephFSVolumeSource struct {
// Required: Monitors is a collection of Ceph monitors
@ -1107,7 +1126,7 @@ type SecretReference struct {
Namespace string
}
// Represents a Ceph Filesystem mount that lasts the lifetime of a pod
// CephFSPersistentVolumeSource represents a Ceph Filesystem mount that lasts the lifetime of a pod
// Cephfs volumes do not support ownership management or SELinux relabeling.
type CephFSPersistentVolumeSource struct {
// Required: Monitors is a collection of Ceph monitors
@ -1130,7 +1149,7 @@ type CephFSPersistentVolumeSource struct {
ReadOnly bool
}
// Represents a Flocker volume mounted by the Flocker agent.
// FlockerVolumeSource represents a Flocker volume mounted by the Flocker agent.
// One and only one of datasetName and datasetUUID should be set.
// Flocker volumes do not support ownership management or SELinux relabeling.
type FlockerVolumeSource struct {
@ -1143,7 +1162,7 @@ type FlockerVolumeSource struct {
DatasetUUID string
}
// Represents a volume containing downward API info.
// DownwardAPIVolumeSource represents a volume containing downward API info.
// Downward API volumes support ownership management and SELinux relabeling.
type DownwardAPIVolumeSource struct {
// Items is a list of DownwardAPIVolume file
@ -1158,7 +1177,7 @@ type DownwardAPIVolumeSource struct {
DefaultMode *int32
}
// Represents a single file containing information from the downward API
// DownwardAPIVolumeFile represents a single file containing information from the downward API
type DownwardAPIVolumeFile struct {
// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
Path string
@ -1177,7 +1196,7 @@ type DownwardAPIVolumeFile struct {
Mode *int32
}
// Represents downward API info for projecting into a projected volume.
// DownwardAPIProjection represents downward API info for projecting into a projected volume.
// Note that this is identical to a downwardAPI volume source without the default
// mode.
type DownwardAPIProjection struct {
@ -1186,7 +1205,7 @@ type DownwardAPIProjection struct {
Items []DownwardAPIVolumeFile
}
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
// AzureFileVolumeSource azureFile represents an Azure File Service mount on the host and bind mount to the pod.
type AzureFileVolumeSource struct {
// the name of secret that contains Azure Storage Account Name and Key
SecretName string
@ -1198,7 +1217,7 @@ type AzureFileVolumeSource struct {
ReadOnly bool
}
// AzureFile represents an Azure File Service mount on the host and bind mount to the pod.
// AzureFilePersistentVolumeSource represents an Azure File Service mount on the host and bind mount to the pod.
type AzureFilePersistentVolumeSource struct {
// the name of secret that contains Azure Storage Account Name and Key
SecretName string
@ -1214,7 +1233,7 @@ type AzureFilePersistentVolumeSource struct {
SecretNamespace *string
}
// Represents a vSphere volume resource.
// VsphereVirtualDiskVolumeSource represents a vSphere volume resource.
type VsphereVirtualDiskVolumeSource struct {
// Path that identifies vSphere volume vmdk
VolumePath string
@ -1231,7 +1250,7 @@ type VsphereVirtualDiskVolumeSource struct {
StoragePolicyID string
}
// Represents a Photon Controller persistent disk resource.
// PhotonPersistentDiskVolumeSource represents a Photon Controller persistent disk resource.
type PhotonPersistentDiskVolumeSource struct {
// ID that identifies Photon Controller persistent disk
PdID string
@ -1256,9 +1275,13 @@ type PortworxVolumeSource struct {
ReadOnly bool
}
// AzureDataDiskCachingMode defines the caching mode for Azure data disk
type AzureDataDiskCachingMode string
// AzureDataDiskKind defines the kind of Azure data disk
type AzureDataDiskKind string
// Defines cache mode and kinds for Azure data disk
const (
AzureDataDiskCachingNone AzureDataDiskCachingMode = "None"
AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly"
@ -1269,7 +1292,7 @@ const (
AzureManagedDisk AzureDataDiskKind = "Managed"
)
// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
// AzureDiskVolumeSource represents an Azure Data Disk mount on the host and bind mount to the pod.
type AzureDiskVolumeSource struct {
// The Name of the data disk in the blob storage
DiskName string
@ -1366,7 +1389,7 @@ type ScaleIOPersistentVolumeSource struct {
ReadOnly bool
}
// Represents a StorageOS persistent volume resource.
// StorageOSVolumeSource represents a StorageOS persistent volume resource.
type StorageOSVolumeSource struct {
// VolumeName is the human-readable name of the StorageOS volume. Volume
// names are only unique within a namespace.
@ -1394,7 +1417,7 @@ type StorageOSVolumeSource struct {
SecretRef *LocalObjectReference
}
// Represents a StorageOS persistent volume resource.
// StorageOSPersistentVolumeSource represents a StorageOS persistent volume resource.
type StorageOSPersistentVolumeSource struct {
// VolumeName is the human-readable name of the StorageOS volume. Volume
// names are only unique within a namespace.
@ -1422,7 +1445,7 @@ type StorageOSPersistentVolumeSource struct {
SecretRef *ObjectReference
}
// Adapts a ConfigMap into a volume.
// ConfigMapVolumeSource adapts a ConfigMap into a volume.
//
// The contents of the target ConfigMap's Data field will be presented in a
// volume as files using the keys in the Data field as the file names, unless
@ -1451,7 +1474,7 @@ type ConfigMapVolumeSource struct {
Optional *bool
}
// Adapts a ConfigMap into a projected volume.
// ConfigMapProjection adapts a ConfigMap into a projected volume.
//
// The contents of the target ConfigMap's Data field will be presented in a
// projected volume as files using the keys in the Data field as the file names,
@ -1496,7 +1519,7 @@ type ServiceAccountTokenProjection struct {
Path string
}
// Represents a projected volume source
// ProjectedVolumeSource represents a projected volume source
type ProjectedVolumeSource struct {
// list of volume projections
Sources []VolumeProjection
@ -1509,7 +1532,7 @@ type ProjectedVolumeSource struct {
DefaultMode *int32
}
// Projection that may be projected along with other supported volume types
// VolumeProjection that may be projected along with other supported volume types
type VolumeProjection struct {
// all types below are the supported types for projection into the same volume
@ -1523,7 +1546,7 @@ type VolumeProjection struct {
ServiceAccountToken *ServiceAccountTokenProjection
}
// Maps a string key to a path within a volume.
// KeyToPath maps a string key to a path within a volume.
type KeyToPath struct {
// The key to project.
Key string
@ -1541,7 +1564,7 @@ type KeyToPath struct {
Mode *int32
}
// Local represents directly-attached storage with node affinity (Beta feature)
// LocalVolumeSource represents directly-attached storage with node affinity (Beta feature)
type LocalVolumeSource struct {
// The full path to the volume on the node.
// It can be either a directory or block device (disk, partition, ...).
@ -1555,7 +1578,7 @@ type LocalVolumeSource struct {
FSType *string
}
// Represents storage that is managed by an external CSI volume driver.
// CSIPersistentVolumeSource represents storage that is managed by an external CSI volume driver.
type CSIPersistentVolumeSource struct {
// Driver is the name of the driver to use for this volume.
// Required.
@ -1615,7 +1638,7 @@ type CSIPersistentVolumeSource struct {
ControllerExpandSecretRef *SecretReference
}
// Represents a source location of a volume to mount, managed by an external CSI driver
// CSIVolumeSource represents a source location of a volume to mount, managed by an external CSI driver
type CSIVolumeSource struct {
// Driver is the name of the CSI driver that handles this volume.
// Consult with your admin for the correct name as registered in the cluster.
@ -1790,7 +1813,7 @@ type ResourceFieldSelector struct {
Divisor resource.Quantity
}
// Selects a key from a ConfigMap.
// ConfigMapKeySelector selects a key from a ConfigMap.
type ConfigMapKeySelector struct {
// The ConfigMap to select from.
LocalObjectReference
@ -2106,6 +2129,7 @@ type Lifecycle struct {
// The below types are used by kube_client and api_server.
// ConditionStatus defines conditions of resources
type ConditionStatus string
// These are valid condition statuses. "ConditionTrue" means a resource is in the condition;
@ -2118,6 +2142,7 @@ const (
ConditionUnknown ConditionStatus = "Unknown"
)
// ContainerStateWaiting represents the waiting state of a container
type ContainerStateWaiting struct {
// A brief CamelCase string indicating details about why the container is in waiting state.
// +optional
@ -2127,11 +2152,13 @@ type ContainerStateWaiting struct {
Message string
}
// ContainerStateRunning represents the running state of a container
type ContainerStateRunning struct {
// +optional
StartedAt metav1.Time
}
// ContainerStateTerminated represents the terminated state of a container
type ContainerStateTerminated struct {
ExitCode int32
// +optional
@ -2160,6 +2187,7 @@ type ContainerState struct {
Terminated *ContainerStateTerminated
}
// ContainerStatus represents the status of a container
type ContainerStatus struct {
// Each container in a pod must have a unique name.
Name string
@ -2202,6 +2230,7 @@ const (
PodUnknown PodPhase = "Unknown"
)
// PodConditionType defines the condition of pod
type PodConditionType string
// These are valid conditions of pod.
@ -2220,6 +2249,7 @@ const (
ContainersReady PodConditionType = "ContainersReady"
)
// PodCondition represents pod's condition
type PodCondition struct {
Type PodConditionType
Status ConditionStatus
@ -2239,6 +2269,7 @@ type PodCondition struct {
// is RestartPolicyAlways.
type RestartPolicy string
// These are valid restart policies
const (
RestartPolicyAlways RestartPolicy = "Always"
RestartPolicyOnFailure RestartPolicy = "OnFailure"
@ -2280,7 +2311,7 @@ const (
DNSNone DNSPolicy = "None"
)
// A node selector represents the union of the results of one or more label queries
// NodeSelector represents the union of the results of one or more label queries
// over a set of nodes; that is, it represents the OR of the selectors represented
// by the node selector terms.
type NodeSelector struct {
@ -2288,6 +2319,7 @@ type NodeSelector struct {
NodeSelectorTerms []NodeSelectorTerm
}
// NodeSelectorTerm represents expressions and fields required to select nodes.
// A null or empty node selector term matches no objects. The requirements of
// them are ANDed.
// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
@ -2298,7 +2330,7 @@ type NodeSelectorTerm struct {
MatchFields []NodeSelectorRequirement
}
// A node selector requirement is a selector that contains values, a key, and an operator
// NodeSelectorRequirement is a selector that contains values, a key, and an operator
// that relates the key and values.
type NodeSelectorRequirement struct {
// The label key that the selector applies to.
@ -2315,10 +2347,11 @@ type NodeSelectorRequirement struct {
Values []string
}
// A node selector operator is the set of operators that can be used in
// NodeSelectorOperator is the set of operators that can be used in
// a node selector requirement.
type NodeSelectorOperator string
// These are valid values of NodeSelectorOperator
const (
NodeSelectorOpIn NodeSelectorOperator = "In"
NodeSelectorOpNotIn NodeSelectorOperator = "NotIn"
@ -2328,7 +2361,7 @@ const (
NodeSelectorOpLt NodeSelectorOperator = "Lt"
)
// A topology selector term represents the result of label queries.
// TopologySelectorTerm represents the result of label queries.
// A null or empty topology selector term matches no objects.
// The requirements of them are ANDed.
// It provides a subset of functionality as NodeSelectorTerm.
@ -2339,7 +2372,7 @@ type TopologySelectorTerm struct {
MatchLabelExpressions []TopologySelectorLabelRequirement
}
// A topology selector requirement is a selector that matches given label.
// TopologySelectorLabelRequirement is a selector that matches given label.
// This is an alpha feature and may change in the future.
type TopologySelectorLabelRequirement struct {
// The label key that the selector applies to.
@ -2362,7 +2395,7 @@ type Affinity struct {
PodAntiAffinity *PodAntiAffinity
}
// Pod affinity is a group of inter pod affinity scheduling rules.
// PodAffinity is a group of inter pod affinity scheduling rules.
type PodAffinity struct {
// NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented.
// If the affinity requirements specified by this field are not met at
@ -2397,7 +2430,7 @@ type PodAffinity struct {
PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm
}
// Pod anti affinity is a group of inter pod anti affinity scheduling rules.
// PodAntiAffinity is a group of inter pod anti affinity scheduling rules.
type PodAntiAffinity struct {
// NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented.
// If the anti-affinity requirements specified by this field are not met at
@ -2432,7 +2465,8 @@ type PodAntiAffinity struct {
PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm
}
// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
// WeightedPodAffinityTerm represents the weights of all of the matched WeightedPodAffinityTerm
// fields are added per-node to find the most preferred node(s)
type WeightedPodAffinityTerm struct {
// weight associated with matching the corresponding podAffinityTerm,
// in the range 1-100.
@ -2441,7 +2475,7 @@ type WeightedPodAffinityTerm struct {
PodAffinityTerm PodAffinityTerm
}
// Defines a set of pods (namely those matching the labelSelector
// PodAffinityTerm defines a set of pods (namely those matching the labelSelector
// relative to the given namespace(s)) that this pod should be
// co-located (affinity) or not co-located (anti-affinity) with,
// where co-located is defined as running on a node whose value of
@ -2463,7 +2497,7 @@ type PodAffinityTerm struct {
TopologyKey string
}
// Node affinity is a group of node affinity scheduling rules.
// NodeAffinity is a group of node affinity scheduling rules.
type NodeAffinity struct {
// NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented.
// If the affinity requirements specified by this field are not met at
@ -2494,7 +2528,7 @@ type NodeAffinity struct {
PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm
}
// An empty preferred scheduling term matches all objects with implicit weight 0
// PreferredSchedulingTerm represents an empty preferred scheduling term matches all objects with implicit weight 0
// (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.
@ -2503,6 +2537,7 @@ type PreferredSchedulingTerm struct {
Preference NodeSelectorTerm
}
// Taint represents taint that can be applied to the node.
// The node this Taint is attached to has the "effect" on
// any pod that does not tolerate the Taint.
type Taint struct {
@ -2521,8 +2556,10 @@ type Taint struct {
TimeAdded *metav1.Time
}
// TaintEffect defines the effects of Taint
type TaintEffect string
// These are valid values for TaintEffect
const (
// Do not allow new pods to schedule onto the node unless they tolerate the taint,
// but allow all pods submitted to Kubelet without going through the scheduler
@ -2544,6 +2581,7 @@ const (
TaintEffectNoExecute TaintEffect = "NoExecute"
)
// Toleration represents the toleration object that can be attached to a pod.
// The pod this Toleration is attached to tolerates any taint that matches
// the triple <key,value,effect> using the matching operator <operator>.
type Toleration struct {
@ -2573,9 +2611,10 @@ type Toleration struct {
TolerationSeconds *int64
}
// A toleration operator is the set of operators that can be used in a toleration.
// TolerationOperator is the set of operators that can be used in a toleration.
type TolerationOperator string
// These are valid values for TolerationOperator
const (
TolerationOpExists TolerationOperator = "Exists"
TolerationOpEqual TolerationOperator = "Equal"
@ -2838,6 +2877,7 @@ type PodSecurityContext struct {
// PodQOSClass defines the supported qos classes of Pods.
type PodQOSClass string
// These are valid values for PodQOSClass
const (
// PodQOSGuaranteed is the Guaranteed qos class.
PodQOSGuaranteed PodQOSClass = "Guaranteed"
@ -2876,6 +2916,7 @@ type PodDNSConfigOption struct {
Value *string
}
// PodIP represents the IP address of a pod.
// IP address information. Each entry includes:
// IP: An IP address allocated to the pod. Routable at least within
// the cluster.
@ -3170,6 +3211,7 @@ type ReplicationControllerStatus struct {
Conditions []ReplicationControllerCondition
}
// ReplicationControllerConditionType defines the conditions of a replication controller.
type ReplicationControllerConditionType string
// These are valid conditions of a replication controller.
@ -3243,7 +3285,7 @@ type ServiceList struct {
Items []Service
}
// Session Affinity Type string
// ServiceAffinity Type string
type ServiceAffinity string
const (
@ -3279,7 +3321,7 @@ type ClientIPConfig struct {
TimeoutSeconds *int32
}
// Service Type string describes ingress methods for a service
// ServiceType string describes ingress methods for a service
type ServiceType string
const (
@ -3302,7 +3344,7 @@ const (
ServiceTypeExternalName ServiceType = "ExternalName"
)
// Service External Traffic Policy Type string
// ServiceExternalTrafficPolicyType string
type ServiceExternalTrafficPolicyType string
const (
@ -3465,6 +3507,7 @@ type ServiceSpec struct {
IPFamily *IPFamily
}
// ServicePort represents the port on which the service is exposed
type ServicePort struct {
// Optional if only one ServicePort is defined on this service: The
// name of this port within the service. This must be a DNS_LABEL.
@ -3657,7 +3700,7 @@ type NodeSpec struct {
// Deprecated. Not all kubelets will set this field. Remove field after 1.13.
// see: https://issues.k8s.io/61966
// +optional
DoNotUse_ExternalID string
DoNotUseExternalID string
}
// NodeConfigSource specifies a source of node configuration. Exactly one subfield must be non-nil.
@ -3665,6 +3708,7 @@ type NodeConfigSource struct {
ConfigMap *ConfigMapNodeConfigSource
}
// ConfigMapNodeConfigSource represents the config map of a node
type ConfigMapNodeConfigSource struct {
// Namespace is the metadata.namespace of the referenced ConfigMap.
// This field is required in all cases.
@ -3820,6 +3864,7 @@ type NodeStatus struct {
Config *NodeConfigStatus
}
// UniqueVolumeName defines the name of attached volume
type UniqueVolumeName string
// AttachedVolume describes a volume attached to a node
@ -3841,7 +3886,7 @@ type AvoidPods struct {
PreferAvoidPods []PreferAvoidPodsEntry
}
// Describes a class of pods that should avoid this node.
// PreferAvoidPodsEntry describes a class of pods that should avoid this node.
type PreferAvoidPodsEntry struct {
// The class of pods.
PodSignature PodSignature
@ -3856,7 +3901,7 @@ type PreferAvoidPodsEntry struct {
Message string
}
// Describes the class of pods that should avoid this node.
// PodSignature describes the class of pods that should avoid this node.
// Exactly one field should be set.
type PodSignature struct {
// Reference to controller whose pods should avoid this node.
@ -3864,7 +3909,7 @@ type PodSignature struct {
PodController *metav1.OwnerReference
}
// Describe a container image
// ContainerImage describe a container image
type ContainerImage struct {
// Names by which this image is known.
Names []string
@ -3873,6 +3918,7 @@ type ContainerImage struct {
SizeBytes int64
}
// NodePhase defines the phase in which a node is in
type NodePhase string
// These are the valid phases of node.
@ -3885,6 +3931,7 @@ const (
NodeTerminated NodePhase = "Terminated"
)
// NodeConditionType defines node's condition
type NodeConditionType string
// These are valid conditions of node. Currently, we don't have enough information to decide
@ -3901,6 +3948,7 @@ const (
NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable"
)
// NodeCondition represents the node's condition
type NodeCondition struct {
Type NodeConditionType
Status ConditionStatus
@ -3914,8 +3962,10 @@ type NodeCondition struct {
Message string
}
// NodeAddressType defines the node's address type
type NodeAddressType string
// These are valid values of node address type
const (
NodeHostName NodeAddressType = "Hostname"
NodeExternalIP NodeAddressType = "ExternalIP"
@ -3924,6 +3974,7 @@ const (
NodeInternalDNS NodeAddressType = "InternalDNS"
)
// NodeAddress represents node's address
type NodeAddress struct {
Type NodeAddressType
Address string
@ -3958,11 +4009,11 @@ const (
)
const (
// Default namespace prefix.
// ResourceDefaultNamespacePrefix is the default namespace prefix.
ResourceDefaultNamespacePrefix = "kubernetes.io/"
// Name prefix for huge page resources (alpha).
// ResourceHugePagesPrefix is the name prefix for huge page resources (alpha).
ResourceHugePagesPrefix = "hugepages-"
// Name prefix for storage resource limits
// ResourceAttachableVolumesPrefix is the name prefix for storage resource limits
ResourceAttachableVolumesPrefix = "attachable-volumes-"
)
@ -4022,6 +4073,7 @@ type NamespaceStatus struct {
Conditions []NamespaceCondition
}
// NamespacePhase defines the phase in which the namespace is
type NamespacePhase string
// These are the valid phases of a namespace.
@ -4058,7 +4110,7 @@ type NamespaceCondition struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// A namespace provides a scope for Names.
// Namespace provides a scope for Names.
// Use of multiple namespaces is optional
type Namespace struct {
metav1.TypeMeta
@ -4101,7 +4153,7 @@ type Binding struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// A list of ephemeral containers used with the Pod ephemeralcontainers subresource.
// EphemeralContainers is a list of ephemeral containers used with the Pod ephemeralcontainers subresource.
type EphemeralContainers struct {
metav1.TypeMeta
// +optional
@ -4301,12 +4353,14 @@ type TypedLocalObjectReference struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SerializedReference represents a serialized object reference
type SerializedReference struct {
metav1.TypeMeta
// +optional
Reference ObjectReference
}
// EventSource represents the source from which an event is generated
type EventSource struct {
// Component from which the event is generated.
// +optional
@ -4394,6 +4448,7 @@ type Event struct {
ReportingInstance string
}
// EventSeries represents a series ov events
type EventSeries struct {
// Number of occurrences in this series up to the last heartbeat time
Count int32
@ -4404,8 +4459,10 @@ type EventSeries struct {
State EventSeriesState
}
// EventSeriesState defines the state of event series
type EventSeriesState string
// These are valid values of event series state
const (
EventSeriesStateOngoing EventSeriesState = "Ongoing"
EventSeriesStateFinished EventSeriesState = "Finished"
@ -4428,15 +4485,15 @@ type EventList struct {
// List holds a list of objects, which may not be known by the server.
type List metainternalversion.List
// A type of object that is limited
// LimitType defines a type of object that is limited
type LimitType string
const (
// Limit that applies to all pods in a namespace
// LimitTypePod defines limit that applies to all pods in a namespace
LimitTypePod LimitType = "Pod"
// Limit that applies to all containers in a namespace
// LimitTypeContainer defines limit that applies to all containers in a namespace
LimitTypeContainer LimitType = "Container"
// Limit that applies to all persistent volume claims in a namespace
// LimitTypePersistentVolumeClaim defines limit that applies to all persistent volume claims in a namespace
LimitTypePersistentVolumeClaim LimitType = "PersistentVolumeClaim"
)
@ -4538,9 +4595,10 @@ const (
DefaultResourceRequestsPrefix = "requests."
)
// A ResourceQuotaScope defines a filter that must match each object tracked by a quota
// ResourceQuotaScope defines a filter that must match each object tracked by a quota
type ResourceQuotaScope string
// These are valid values for resource quota spec
const (
// Match all pod objects where spec.activeDeadlineSeconds
ResourceQuotaScopeTerminating ResourceQuotaScope = "Terminating"
@ -4569,7 +4627,7 @@ type ResourceQuotaSpec struct {
ScopeSelector *ScopeSelector
}
// A scope selector represents the AND of the selectors represented
// ScopeSelector represents the AND of the selectors represented
// by the scoped-resource selector terms.
type ScopeSelector struct {
// A list of scope selector requirements by scope of the resources.
@ -4577,7 +4635,7 @@ type ScopeSelector struct {
MatchExpressions []ScopedResourceSelectorRequirement
}
// A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator
// ScopedResourceSelectorRequirement is a selector that contains values, a scope name, and an operator
// that relates the scope name and values.
type ScopedResourceSelectorRequirement struct {
// The name of the scope that the selector applies to.
@ -4593,10 +4651,11 @@ type ScopedResourceSelectorRequirement struct {
Values []string
}
// A scope selector operator is the set of operators that can be used in
// ScopeSelectorOperator is the set of operators that can be used in
// a scope selector requirement.
type ScopeSelectorOperator string
// These are the valid values for ScopeSelectorOperator
const (
ScopeSelectorOpIn ScopeSelectorOperator = "In"
ScopeSelectorOpNotIn ScopeSelectorOperator = "NotIn"
@ -4664,10 +4723,13 @@ type Secret struct {
Type SecretType
}
// MaxSecretSize represents the max secret size.
const MaxSecretSize = 1 * 1024 * 1024
// SecretType defines the types of secrets
type SecretType string
// These are the valid values for SecretType
const (
// SecretTypeOpaque is the default; arbitrary user-defined data
SecretTypeOpaque SecretType = "Opaque"
@ -4702,14 +4764,14 @@ const (
// DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets
DockerConfigKey = ".dockercfg"
// SecretTypeDockerConfigJson contains a dockercfg file that follows the same format rules as ~/.docker/config.json
// SecretTypeDockerConfigJSON contains a dockercfg file that follows the same format rules as ~/.docker/config.json
//
// Required fields:
// - Secret.Data[".dockerconfigjson"] - a serialized ~/.docker/config.json file
SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson"
SecretTypeDockerConfigJSON SecretType = "kubernetes.io/dockerconfigjson"
// DockerConfigJsonKey is the key of the required data for SecretTypeDockerConfigJson secrets
DockerConfigJsonKey = ".dockerconfigjson"
// DockerConfigJSONKey is the key of the required data for SecretTypeDockerConfigJson secrets
DockerConfigJSONKey = ".dockerconfigjson"
// SecretTypeBasicAuth contains data needed for basic authentication.
//
@ -4754,6 +4816,7 @@ const (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SecretList represents the list of secrets
type SecretList struct {
metav1.TypeMeta
// +optional
@ -4842,7 +4905,7 @@ const (
PortForwardRequestIDHeader = "requestID"
)
// Type and constants for component health validation.
// ComponentConditionType defines type and constants for component health validation.
type ComponentConditionType string
// These are the valid conditions for the component.
@ -4850,6 +4913,7 @@ const (
ComponentHealthy ComponentConditionType = "Healthy"
)
// ComponentCondition represents the condition of a component
type ComponentCondition struct {
Type ComponentConditionType
Status ConditionStatus
@ -4873,6 +4937,7 @@ type ComponentStatus struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ComponentStatusList represents the list of component statuses
type ComponentStatusList struct {
metav1.TypeMeta
// +optional
@ -4941,6 +5006,7 @@ type SecurityContext struct {
ProcMount *ProcMountType
}
// ProcMountType defines the type of proc mount
type ProcMountType string
const (
@ -5019,9 +5085,11 @@ type RangeAllocation struct {
}
const (
// "default-scheduler" is the name of default scheduler.
// DefaultSchedulerName defines the name of default scheduler.
DefaultSchedulerName = "default-scheduler"
// DefaultHardPodAffinitySymmetricWeight is the weight of implicit PreferredDuringScheduling affinity rule.
//
// RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule
// corresponding to every RequiredDuringScheduling affinity rule.
// When the --hard-pod-affinity-weight scheduler flag is not specified,
@ -5029,6 +5097,8 @@ const (
DefaultHardPodAffinitySymmetricWeight int32 = 1
)
// UnsatisfiableConstraintAction defines the actions that can be taken for an
// unsatisfiable constraint.
type UnsatisfiableConstraintAction string
const (

View File

@ -4836,7 +4836,7 @@ func autoConvert_v1_NodeSpec_To_core_NodeSpec(in *v1.NodeSpec, out *core.NodeSpe
out.Unschedulable = in.Unschedulable
out.Taints = *(*[]core.Taint)(unsafe.Pointer(&in.Taints))
out.ConfigSource = (*core.NodeConfigSource)(unsafe.Pointer(in.ConfigSource))
out.DoNotUse_ExternalID = in.DoNotUse_ExternalID
out.DoNotUseExternalID = in.DoNotUseExternalID
return nil
}
@ -4846,7 +4846,7 @@ func autoConvert_core_NodeSpec_To_v1_NodeSpec(in *core.NodeSpec, out *v1.NodeSpe
out.Unschedulable = in.Unschedulable
out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints))
out.ConfigSource = (*v1.NodeConfigSource)(unsafe.Pointer(in.ConfigSource))
out.DoNotUse_ExternalID = in.DoNotUse_ExternalID
out.DoNotUseExternalID = in.DoNotUseExternalID
return nil
}

View File

@ -4921,16 +4921,16 @@ func ValidateSecret(secret *core.Secret) field.ErrorList {
if err := json.Unmarshal(dockercfgBytes, &map[string]interface{}{}); err != nil {
allErrs = append(allErrs, field.Invalid(dataPath.Key(core.DockerConfigKey), "<secret contents redacted>", err.Error()))
}
case core.SecretTypeDockerConfigJson:
dockerConfigJsonBytes, exists := secret.Data[core.DockerConfigJsonKey]
case core.SecretTypeDockerConfigJSON:
dockerConfigJSONBytes, exists := secret.Data[core.DockerConfigJSONKey]
if !exists {
allErrs = append(allErrs, field.Required(dataPath.Key(core.DockerConfigJsonKey), ""))
allErrs = append(allErrs, field.Required(dataPath.Key(core.DockerConfigJSONKey), ""))
break
}
// make sure that the content is well-formed json.
if err := json.Unmarshal(dockerConfigJsonBytes, &map[string]interface{}{}); err != nil {
allErrs = append(allErrs, field.Invalid(dataPath.Key(core.DockerConfigJsonKey), "<secret contents redacted>", err.Error()))
if err := json.Unmarshal(dockerConfigJSONBytes, &map[string]interface{}{}); err != nil {
allErrs = append(allErrs, field.Invalid(dataPath.Key(core.DockerConfigJSONKey), "<secret contents redacted>", err.Error()))
}
case core.SecretTypeBasicAuth:
_, usernameFieldExists := secret.Data[core.BasicAuthUsernameKey]

View File

@ -13099,9 +13099,9 @@ func TestValidateDockerConfigSecret(t *testing.T) {
validDockerSecret2 := func() core.Secret {
return core.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "bar"},
Type: core.SecretTypeDockerConfigJson,
Type: core.SecretTypeDockerConfigJSON,
Data: map[string][]byte{
core.DockerConfigJsonKey: []byte(`{"auths":{"https://index.docker.io/v1/": {"auth": "Y2x1ZWRyb29sZXIwMDAxOnBhc3N3b3Jk","email": "fake@example.com"}}}`),
core.DockerConfigJSONKey: []byte(`{"auths":{"https://index.docker.io/v1/": {"auth": "Y2x1ZWRyb29sZXIwMDAxOnBhc3N3b3Jk","email": "fake@example.com"}}}`),
},
}
}
@ -13118,9 +13118,9 @@ func TestValidateDockerConfigSecret(t *testing.T) {
delete(missingDockerConfigKey.Data, core.DockerConfigKey)
emptyDockerConfigKey.Data[core.DockerConfigKey] = []byte("")
invalidDockerConfigKey.Data[core.DockerConfigKey] = []byte("bad")
delete(missingDockerConfigKey2.Data, core.DockerConfigJsonKey)
emptyDockerConfigKey2.Data[core.DockerConfigJsonKey] = []byte("")
invalidDockerConfigKey2.Data[core.DockerConfigJsonKey] = []byte("bad")
delete(missingDockerConfigKey2.Data, core.DockerConfigJSONKey)
emptyDockerConfigKey2.Data[core.DockerConfigJSONKey] = []byte("")
invalidDockerConfigKey2.Data[core.DockerConfigJSONKey] = []byte("bad")
tests := map[string]struct {
secret core.Secret

View File

@ -657,9 +657,9 @@ func TestPodLimitFuncApplyDefault(t *testing.T) {
for i := range testPod.Spec.Containers {
container := testPod.Spec.Containers[i]
limitMemory := container.Resources.Limits.Memory().String()
limitCPU := container.Resources.Limits.Cpu().String()
limitCPU := container.Resources.Limits.CPU().String()
requestMemory := container.Resources.Requests.Memory().String()
requestCPU := container.Resources.Requests.Cpu().String()
requestCPU := container.Resources.Requests.CPU().String()
if limitMemory != "10Mi" {
t.Errorf("Unexpected limit memory value %s", limitMemory)
@ -678,9 +678,9 @@ func TestPodLimitFuncApplyDefault(t *testing.T) {
for i := range testPod.Spec.InitContainers {
container := testPod.Spec.InitContainers[i]
limitMemory := container.Resources.Limits.Memory().String()
limitCPU := container.Resources.Limits.Cpu().String()
limitCPU := container.Resources.Limits.CPU().String()
requestMemory := container.Resources.Requests.Memory().String()
requestCPU := container.Resources.Requests.Cpu().String()
requestCPU := container.Resources.Requests.CPU().String()
if limitMemory != "10Mi" {
t.Errorf("Unexpected limit memory value %s", limitMemory)

File diff suppressed because it is too large Load Diff

View File

@ -4233,7 +4233,7 @@ type NodeSpec struct {
// Deprecated. Not all kubelets will set this field. Remove field after 1.13.
// see: https://issues.k8s.io/61966
// +optional
DoNotUse_ExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"`
DoNotUseExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"`
}
// NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.