@@ -131,22 +131,25 @@ func IsOvercommitAllowed(name v1.ResourceName) bool {
131
131
! IsHugePageResourceName (name )
132
132
}
133
133
134
+ // IsAttachableVolumeResourceName returns true when the resource name is prefixed in attachable volume
134
135
func IsAttachableVolumeResourceName (name v1.ResourceName ) bool {
135
136
return strings .HasPrefix (string (name ), v1 .ResourceAttachableVolumesPrefix )
136
137
}
137
138
138
- // Extended and Hugepages resources
139
+ // IsScalarResourceName validates the resource for Extended, Hugepages, Native and AttachableVolume resources
139
140
func IsScalarResourceName (name v1.ResourceName ) bool {
140
141
return IsExtendedResourceName (name ) || IsHugePageResourceName (name ) ||
141
142
IsPrefixedNativeResource (name ) || IsAttachableVolumeResourceName (name )
142
143
}
143
144
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
145
146
// the objective is not to perform validation here
146
147
func IsServiceIPSet (service * v1.Service ) bool {
147
148
return service .Spec .ClusterIP != v1 .ClusterIPNone && service .Spec .ClusterIP != ""
148
149
}
149
150
151
+ // LoadBalancerStatusEqual evaluates the given load balancers' ingress IP addresses
152
+ // and hostnames and returns true if equal or false if otherwise
150
153
// TODO: make method on LoadBalancerStatus?
151
154
func LoadBalancerStatusEqual (l , r * v1.LoadBalancerStatus ) bool {
152
155
return ingressSliceEqual (l .Ingress , r .Ingress )
@@ -191,7 +194,7 @@ func GetAccessModesAsString(modes []v1.PersistentVolumeAccessMode) string {
191
194
return strings .Join (modesStr , "," )
192
195
}
193
196
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
195
198
func GetAccessModesFromString (modes string ) []v1.PersistentVolumeAccessMode {
196
199
strmodes := strings .Split (modes , "," )
197
200
accessModes := []v1.PersistentVolumeAccessMode {}
@@ -467,7 +470,7 @@ func getFilteredTaints(taints []v1.Taint, inclusionFilter taintsFilterFunc) []v1
467
470
return filteredTaints
468
471
}
469
472
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.
471
474
func GetMatchingTolerations (taints []v1.Taint , tolerations []v1.Toleration ) (bool , []v1.Toleration ) {
472
475
if len (taints ) == 0 {
473
476
return true , []v1.Toleration {}
@@ -492,6 +495,8 @@ func GetMatchingTolerations(taints []v1.Taint, tolerations []v1.Toleration) (boo
492
495
return true , result
493
496
}
494
497
498
+ // GetAvoidPodsFromNodeAnnotations scans the list of annotations and
499
+ // returns the pods that needs to be avoided for this node from scheduling
495
500
func GetAvoidPodsFromNodeAnnotations (annotations map [string ]string ) (v1.AvoidPods , error ) {
496
501
var avoidPods v1.AvoidPods
497
502
if len (annotations ) > 0 && annotations [v1 .PreferAvoidPodsAnnotationKey ] != "" {
0 commit comments