Skip to content

Commit b4a088f

Browse files
authored
Merge pull request kubernetes#88217 from gkarthiks/master
fix: golint failures
2 parents cf1b72e + 8853a98 commit b4a088f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pkg/apis/certificates/v1beta1
2525
pkg/apis/certificates/validation
2626
pkg/apis/core/helper/qos
2727
pkg/apis/core/v1
28-
pkg/apis/core/v1/helper
2928
pkg/apis/core/v1/helper/qos
3029
pkg/apis/core/validation
3130
pkg/apis/discovery/v1alpha1

pkg/apis/core/v1/helper/helpers.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,25 @@ func IsOvercommitAllowed(name v1.ResourceName) bool {
131131
!IsHugePageResourceName(name)
132132
}
133133

134+
// IsAttachableVolumeResourceName returns true when the resource name is prefixed in attachable volume
134135
func IsAttachableVolumeResourceName(name v1.ResourceName) bool {
135136
return strings.HasPrefix(string(name), v1.ResourceAttachableVolumesPrefix)
136137
}
137138

138-
// Extended and Hugepages resources
139+
// IsScalarResourceName validates the resource for Extended, Hugepages, Native and AttachableVolume resources
139140
func IsScalarResourceName(name v1.ResourceName) bool {
140141
return IsExtendedResourceName(name) || IsHugePageResourceName(name) ||
141142
IsPrefixedNativeResource(name) || IsAttachableVolumeResourceName(name)
142143
}
143144

144-
// this function aims to check if the service's ClusterIP is set or not
145+
// IsServiceIPSet aims to check if the service's ClusterIP is set or not
145146
// the objective is not to perform validation here
146147
func IsServiceIPSet(service *v1.Service) bool {
147148
return service.Spec.ClusterIP != v1.ClusterIPNone && service.Spec.ClusterIP != ""
148149
}
149150

151+
// LoadBalancerStatusEqual evaluates the given load balancers' ingress IP addresses
152+
// and hostnames and returns true if equal or false if otherwise
150153
// TODO: make method on LoadBalancerStatus?
151154
func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool {
152155
return ingressSliceEqual(l.Ingress, r.Ingress)
@@ -191,7 +194,7 @@ func GetAccessModesAsString(modes []v1.PersistentVolumeAccessMode) string {
191194
return strings.Join(modesStr, ",")
192195
}
193196

194-
// GetAccessModesAsString returns an array of AccessModes from a string created by GetAccessModesAsString
197+
// GetAccessModesFromString returns an array of AccessModes from a string created by GetAccessModesAsString
195198
func GetAccessModesFromString(modes string) []v1.PersistentVolumeAccessMode {
196199
strmodes := strings.Split(modes, ",")
197200
accessModes := []v1.PersistentVolumeAccessMode{}
@@ -467,7 +470,7 @@ func getFilteredTaints(taints []v1.Taint, inclusionFilter taintsFilterFunc) []v1
467470
return filteredTaints
468471
}
469472

470-
// Returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
473+
// GetMatchingTolerations returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
471474
func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (bool, []v1.Toleration) {
472475
if len(taints) == 0 {
473476
return true, []v1.Toleration{}
@@ -492,6 +495,8 @@ func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (boo
492495
return true, result
493496
}
494497

498+
// GetAvoidPodsFromNodeAnnotations scans the list of annotations and
499+
// returns the pods that needs to be avoided for this node from scheduling
495500
func GetAvoidPodsFromNodeAnnotations(annotations map[string]string) (v1.AvoidPods, error) {
496501
var avoidPods v1.AvoidPods
497502
if len(annotations) > 0 && annotations[v1.PreferAvoidPodsAnnotationKey] != "" {

0 commit comments

Comments
 (0)