Skip to content

Commit fb292c2

Browse files
Freax13katexochen
authored andcommitted
azure: don't fill in CommunityGalleryInfo for private galleries
Azure will reject any attempts to create a private gallery with the CommunityGalleryInfo filled in.
1 parent c8a482d commit fb292c2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: azure/uploader.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,20 @@ func (u *Uploader) ensureSIG(ctx context.Context) error {
358358
return nil
359359
}
360360
u.log.Printf("Creating image gallery %s in %s", sigName, rg)
361+
var communityGalleryInfo *armcomputev5.CommunityGalleryInfo
362+
if u.config.Azure.SharingProfile == "community" {
363+
communityGalleryInfo = &armcomputev5.CommunityGalleryInfo{
364+
PublicNamePrefix: &pubNamePrefix,
365+
Eula: toPtr("none"),
366+
PublisherContact: toPtr("[email protected]"),
367+
PublisherURI: toPtr("https://foo.bar"),
368+
}
369+
}
361370
gallery := armcomputev5.Gallery{
362371
Location: &u.config.Azure.Location,
363372
Properties: &armcomputev5.GalleryProperties{
364373
SharingProfile: &armcomputev5.SharingProfile{
365-
CommunityGalleryInfo: &armcomputev5.CommunityGalleryInfo{
366-
PublicNamePrefix: &pubNamePrefix,
367-
Eula: toPtr("none"),
368-
PublisherContact: toPtr("[email protected]"),
369-
PublisherURI: toPtr("https://foo.bar"),
370-
},
374+
CommunityGalleryInfo: communityGalleryInfo,
371375
Permissions: sharingProf,
372376
},
373377
},

0 commit comments

Comments
 (0)