@@ -110,22 +110,25 @@ func IsOvercommitAllowed(name v1.ResourceName) bool {
110
110
! IsHugePageResourceName (name )
111
111
}
112
112
113
+ // IsAttachableVolumeResourceName returns true when the resource name is prefixed in attachable volume
113
114
func IsAttachableVolumeResourceName (name v1.ResourceName ) bool {
114
115
return strings .HasPrefix (string (name ), v1 .ResourceAttachableVolumesPrefix )
115
116
}
116
117
117
- // Extended and Hugepages resources
118
+ // IsScalarResourceName validates the resource for Extended, Hugepages, Native and AttachableVolume resources
118
119
func IsScalarResourceName (name v1.ResourceName ) bool {
119
120
return IsExtendedResourceName (name ) || IsHugePageResourceName (name ) ||
120
121
IsPrefixedNativeResource (name ) || IsAttachableVolumeResourceName (name )
121
122
}
122
123
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
124
125
// the objective is not to perform validation here
125
126
func IsServiceIPSet (service * v1.Service ) bool {
126
127
return service .Spec .ClusterIP != v1 .ClusterIPNone && service .Spec .ClusterIP != ""
127
128
}
128
129
130
+ // LoadBalancerStatusEqual evaluates the given load balancers' ingress IP addresses
131
+ // and hostnames and returns true if equal or false if otherwise
129
132
// TODO: make method on LoadBalancerStatus?
130
133
func LoadBalancerStatusEqual (l , r * v1.LoadBalancerStatus ) bool {
131
134
return ingressSliceEqual (l .Ingress , r .Ingress )
@@ -170,7 +173,7 @@ func GetAccessModesAsString(modes []v1.PersistentVolumeAccessMode) string {
170
173
return strings .Join (modesStr , "," )
171
174
}
172
175
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
174
177
func GetAccessModesFromString (modes string ) []v1.PersistentVolumeAccessMode {
175
178
strmodes := strings .Split (modes , "," )
176
179
accessModes := []v1.PersistentVolumeAccessMode {}
@@ -446,7 +449,7 @@ func getFilteredTaints(taints []v1.Taint, inclusionFilter taintsFilterFunc) []v1
446
449
return filteredTaints
447
450
}
448
451
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.
450
453
func GetMatchingTolerations (taints []v1.Taint , tolerations []v1.Toleration ) (bool , []v1.Toleration ) {
451
454
if len (taints ) == 0 {
452
455
return true , []v1.Toleration {}
@@ -471,6 +474,8 @@ func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (boo
471
474
return true , result
472
475
}
473
476
477
+ // GetAvoidPodsFromNodeAnnotations scans the list of annotations and
478
+ // returns the pods that needs to be avoided for this node from scheduling
474
479
func GetAvoidPodsFromNodeAnnotations (annotations map [string ]string ) (v1.AvoidPods , error ) {
475
480
var avoidPods v1.AvoidPods
476
481
if len (annotations ) > 0 && annotations [v1 .PreferAvoidPodsAnnotationKey ] != "" {
0 commit comments