Skip to content

Commit 8853a98

Browse files
committed
fix: golint failures
Signed-off-by: gkarthiks <[email protected]>
1 parent 3d09d25 commit 8853a98

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/v1/validation
3130
pkg/apis/core/validation

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

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

113+
// IsAttachableVolumeResourceName returns true when the resource name is prefixed in attachable volume
113114
func IsAttachableVolumeResourceName(name v1.ResourceName) bool {
114115
return strings.HasPrefix(string(name), v1.ResourceAttachableVolumesPrefix)
115116
}
116117

117-
// Extended and Hugepages resources
118+
// IsScalarResourceName validates the resource for Extended, Hugepages, Native and AttachableVolume resources
118119
func IsScalarResourceName(name v1.ResourceName) bool {
119120
return IsExtendedResourceName(name) || IsHugePageResourceName(name) ||
120121
IsPrefixedNativeResource(name) || IsAttachableVolumeResourceName(name)
121122
}
122123

123-
// this function aims to check if the service's ClusterIP is set or not
124+
// IsServiceIPSet aims to check if the service's ClusterIP is set or not
124125
// the objective is not to perform validation here
125126
func IsServiceIPSet(service *v1.Service) bool {
126127
return service.Spec.ClusterIP != v1.ClusterIPNone && service.Spec.ClusterIP != ""
127128
}
128129

130+
// LoadBalancerStatusEqual evaluates the given load balancers' ingress IP addresses
131+
// and hostnames and returns true if equal or false if otherwise
129132
// TODO: make method on LoadBalancerStatus?
130133
func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool {
131134
return ingressSliceEqual(l.Ingress, r.Ingress)
@@ -170,7 +173,7 @@ func GetAccessModesAsString(modes []v1.PersistentVolumeAccessMode) string {
170173
return strings.Join(modesStr, ",")
171174
}
172175

173-
// GetAccessModesAsString returns an array of AccessModes from a string created by GetAccessModesAsString
176+
// GetAccessModesFromString returns an array of AccessModes from a string created by GetAccessModesAsString
174177
func GetAccessModesFromString(modes string) []v1.PersistentVolumeAccessMode {
175178
strmodes := strings.Split(modes, ",")
176179
accessModes := []v1.PersistentVolumeAccessMode{}
@@ -446,7 +449,7 @@ func getFilteredTaints(taints []v1.Taint, inclusionFilter taintsFilterFunc) []v1
446449
return filteredTaints
447450
}
448451

449-
// Returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
452+
// GetMatchingTolerations returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
450453
func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (bool, []v1.Toleration) {
451454
if len(taints) == 0 {
452455
return true, []v1.Toleration{}
@@ -471,6 +474,8 @@ func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (boo
471474
return true, result
472475
}
473476

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

0 commit comments

Comments
 (0)