Skip to content

Commit 663baae

Browse files
committed
fixes and logs
1 parent e2b8a15 commit 663baae

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

e2e/config/azure.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (a *AzureClient) assignRolesToVMIdentity(ctx context.Context, principalID *
365365
return nil
366366
}
367367

368-
func (a *AzureClient) LatestSIGImageVersionByTag(ctx context.Context, image *Image, tagName, tagValue string) (VHDResourceID, error) {
368+
func (a *AzureClient) LatestSIGImageVersionByTag(ctx context.Context, t *testing.T, image *Image, tagName, tagValue string) (VHDResourceID, error) {
369369
galleryImageVersion, err := armcompute.NewGalleryImageVersionsClient(image.Gallery.SubscriptionID, a.Credential, a.ArmOptions)
370370
if err != nil {
371371
return "", fmt.Errorf("create a new images client: %v", err)
@@ -379,6 +379,7 @@ func (a *AzureClient) LatestSIGImageVersionByTag(ctx context.Context, image *Ima
379379
}
380380
versions := page.Value
381381
for _, version := range versions {
382+
t.Logf("Found image version: %s", version.Tags)
382383
// skip images tagged with the no-selection tag, indicating they
383384
// shouldn't be selected dynmically for running abe2e scenarios
384385
if _, ok := version.Tags[noSelectionTagName]; ok {

e2e/config/vhd.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,16 @@ func (i *Image) VHDResourceID(ctx context.Context, t *testing.T) (VHDResourceID,
223223
i.vhd, i.vhdErr = Azure.EnsureSIGImageVersion(ctx, i)
224224
t.Logf("got version vid %s: %s", i.Version, i.vhd)
225225
default:
226-
i.vhd, i.vhdErr = Azure.LatestSIGImageVersionByTag(ctx, i, Config.SIGVersionTagName, Config.SIGVersionTagValue)
226+
t.Logf("version: %s", i.Version)
227+
i.vhd, i.vhdErr = Azure.LatestSIGImageVersionByTag(ctx, t, i, Config.SIGVersionTagName, Config.SIGVersionTagValue)
227228
t.Logf("got version by tag %s=%s: %s", Config.SIGVersionTagName, Config.SIGVersionTagValue, i.vhd)
228229
}
229230
if i.vhdErr != nil {
230231
i.vhdErr = fmt.Errorf("img: %s, tag %s=%s, err %w", i.Name, Config.SIGVersionTagName, Config.SIGVersionTagValue, i.vhdErr)
231-
t.Logf("failed to find the image sub=%s rg=%s gallary=%s version for with id %s", i.Gallery.SubscriptionID, i.Gallery.ResourceGroupName, i.Gallery.Name, i.vhdErr)
232+
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)
233+
} else {
234+
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())
235+
232236
}
233237
})
234238
return i.vhd, i.vhdErr

e2e/vmss.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ func createVMSS(ctx context.Context, s *Scenario) *armcompute.VirtualMachineScal
5353
}
5454

5555
if nodeBootstrapping != nil && nodeBootstrapping.SigImageConfig != nil {
56-
s.T.Logf("vhd sub id %s", nodeBootstrapping.SigImageConfig.SubscriptionID)
57-
s.T.Logf("vhd rgr id %s", nodeBootstrapping.SigImageConfig.ResourceGroup)
58-
s.T.Logf("vhd galler %s", nodeBootstrapping.SigImageConfig.Gallery)
56+
s.T.Logf("vhd sub id %s", config.Config.SubscriptionID)
57+
s.T.Logf("vhd rgr id %s", config.ResourceGroupName)
58+
s.T.Logf("vhd galler %s", config.Config.GalleryNameWindows)
5959
s.T.Logf("vhd versio %s", nodeBootstrapping.SigImageConfig.Version)
6060
s.T.Logf("vhd defini %s", nodeBootstrapping.SigImageConfig.Definition)
6161
} else {

0 commit comments

Comments
 (0)