Add Unit Tests for getIngressInformation
Adds a unit test for the getIngressInformation function.
This commit is contained in:
parent
c6629accf9
commit
429110aa13
2 changed files with 92 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
text_template "text/template"
|
||||
|
|
@ -762,6 +763,23 @@ type ingressInformation struct {
|
|||
Annotations map[string]string
|
||||
}
|
||||
|
||||
func (info *ingressInformation) Equal(other *ingressInformation) bool {
|
||||
if info.Namespace != other.Namespace {
|
||||
return false
|
||||
}
|
||||
if info.Rule != other.Rule {
|
||||
return false
|
||||
}
|
||||
if info.Service != other.Service {
|
||||
return false
|
||||
}
|
||||
if !reflect.DeepEqual(info.Annotations, other.Annotations) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func getIngressInformation(i, p interface{}) *ingressInformation {
|
||||
ing, ok := i.(*ingress.Ingress)
|
||||
if !ok {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue