ib-kubernetes icon indicating copy to clipboard operation
ib-kubernetes copied to clipboard

Change functions/variables to make them aligned with context

Open DmytroLinkin opened this issue 5 years ago • 5 comments
trafficstars

Some functions/variables names can confuse what they really do. For ex., in pkg/utils/utils.go:

 35 // HasNetworkAttachment check if pod has Network Attachment
 36 func HasNetworkAttachment(pod *kapi.Pod) bool {
 37         return len(pod.Annotations[v1.NetworkAttachmentAnnot]) > 0
 38 }

function actually check network attachment annotations, not network attachment.

DmytroLinkin avatar Jul 28 '20 12:07 DmytroLinkin

@adrianchiris

DmytroLinkin avatar Jul 28 '20 12:07 DmytroLinkin

a pod is associated with a network attachment if it has a network attachment annotation. so im not sure there is an issue here.

can you elaborate on why you think there is an issue ?

adrianchiris avatar Aug 12 '20 13:08 adrianchiris

Originally, You complained that name of this function a bit confusing.

DmytroLinkin avatar Aug 12 '20 13:08 DmytroLinkin

yea well, i dont remember what was confusing :)

adrianchiris avatar Aug 12 '20 13:08 adrianchiris

So this should be renamed to: HasNetworkAttachmentAnnot()

adrianchiris avatar Jan 06 '21 12:01 adrianchiris