Skip to content

Commit 02364dd

Browse files
committed
error logging
1 parent bd63790 commit 02364dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

e2e/config/vhd.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,20 @@ func (i *Image) VHDResourceID(ctx context.Context, t *testing.T) (VHDResourceID,
221221
switch {
222222
case i.Version != "":
223223
i.vhd, i.vhdErr = Azure.EnsureSIGImageVersion(ctx, t, i)
224-
t.Logf("got version vid %s: %s", i.Version, i.vhd)
224+
if i.vhd != "" {
225+
t.Logf("got version vid %s: %s", i.Version, i.vhd)
226+
}
225227
default:
226228
i.vhd, i.vhdErr = Azure.LatestSIGImageVersionByTag(ctx, t, i, Config.SIGVersionTagName, Config.SIGVersionTagValue)
227-
t.Logf("got version by tag %s=%s: %s", Config.SIGVersionTagName, Config.SIGVersionTagValue, i.vhd)
229+
if i.vhd != "" {
230+
t.Logf("got version by tag %s=%s: %s", Config.SIGVersionTagName, Config.SIGVersionTagValue, i.vhd)
231+
}
228232
}
229233
if i.vhdErr != nil {
230234
i.vhdErr = fmt.Errorf("img: %s, tag %s=%s, err %w", i.Name, Config.SIGVersionTagName, Config.SIGVersionTagValue, i.vhdErr)
231235
t.Logf("Failed to find the image. Sub=%s rg=%s gallary=%s version for with err %s", i.Gallery.SubscriptionID, i.Gallery.ResourceGroupName, i.Gallery.Name, i.vhdErr)
232236
} else {
233237
t.Logf("Found the image. Sub=%s rg=%s gallary=%s version for with id %s", i.Gallery.SubscriptionID, i.Gallery.ResourceGroupName, i.Gallery.Name, i.vhd.Short())
234-
235238
}
236239
})
237240
return i.vhd, i.vhdErr

0 commit comments

Comments
 (0)