File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ func PodScheduled(pod *kapi.Pod) bool {
3333 return pod .Spec .NodeName != ""
3434}
3535
36- // HasNetworkAttachment check if pod has Network Attachment
37- func HasNetworkAttachment (pod * kapi.Pod ) bool {
36+ // HasNetworkAttachmentAnnot check if pod has Network Attachment Annotation
37+ func HasNetworkAttachmentAnnot (pod * kapi.Pod ) bool {
3838 return len (pod .Annotations [v1 .NetworkAttachmentAnnot ]) > 0
3939}
4040
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ var _ = Describe("Utils", func() {
2121 Expect (PodScheduled (pod )).To (BeTrue ())
2222 })
2323 })
24- Context ("HasNetworkAttachment " , func () {
24+ Context ("HasNetworkAttachmentAnnot " , func () {
2525 It ("Check pod if pod is has network attachment annotation" , func () {
2626 pod := & kapi.Pod {ObjectMeta : metav1.ObjectMeta {
2727 Annotations : map [string ]string {v1 .NetworkAttachmentAnnot : `[{"name":"test"}]` }}}
28- Expect (HasNetworkAttachment (pod )).To (BeTrue ())
28+ Expect (HasNetworkAttachmentAnnot (pod )).To (BeTrue ())
2929 })
3030 })
3131 Context ("PodIsRunning" , func () {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func (p *podEventHandler) OnAdd(obj interface{}) {
4949 return
5050 }
5151
52- if ! utils .HasNetworkAttachment (pod ) {
52+ if ! utils .HasNetworkAttachmentAnnot (pod ) {
5353 log .Debug ().Msgf ("pod doesn't have network annotation \" %v\" " , v1 .NetworkAttachmentAnnot )
5454 return
5555 }
@@ -83,7 +83,7 @@ func (p *podEventHandler) OnUpdate(oldObj, newObj interface{}) {
8383 return
8484 }
8585
86- if ! utils .HasNetworkAttachment (pod ) {
86+ if ! utils .HasNetworkAttachmentAnnot (pod ) {
8787 log .Debug ().Msgf ("pod doesn't have network annotation \" %v\" " , v1 .NetworkAttachmentAnnot )
8888 return
8989 }
@@ -115,7 +115,7 @@ func (p *podEventHandler) OnDelete(obj interface{}) {
115115 return
116116 }
117117
118- if ! utils .HasNetworkAttachment (pod ) {
118+ if ! utils .HasNetworkAttachmentAnnot (pod ) {
119119 log .Debug ().Msgf ("pod doesn't have network annotation \" %v\" " , v1 .NetworkAttachmentAnnot )
120120 return
121121 }
You can’t perform that action at this time.
0 commit comments