File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,21 @@ func GetCurrentServiceRevision(t *testing.T, serviceName string) string {
4848}
4949
5050func GetKnativeServiceRevisionAndUrl (t * testing.T , serviceName string ) (revision string , url string ) {
51+ t .Helper ()
52+ var ok bool
5153 resource := RetrieveKnativeServiceResource (t , serviceName )
5254 rootMap := resource .UnstructuredContent ()
53- statusMap := rootMap ["status" ].(map [string ]interface {})
54- revision = statusMap ["latestReadyRevisionName" ].(string )
55- url = statusMap ["url" ].(string )
55+ statusMap , ok := rootMap ["status" ].(map [string ]interface {})
56+ if ! ok {
57+ t .Fatal ("absent status" )
58+ }
59+ revision , ok = statusMap ["latestReadyRevisionName" ].(string )
60+ if ! ok {
61+ t .Fatal ("absent ready revision" )
62+ }
63+ url , ok = statusMap ["url" ].(string )
64+ if ! ok {
65+ t .Fatal ("absent url" )
66+ }
5667 return revision , url
5768}
You can’t perform that action at this time.
0 commit comments