mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
node-operator: fix setting Azure node image (#2788)
This commit is contained in:
parent
45479b307e
commit
9826ab2e89
@ -165,7 +165,7 @@ func imageReferenceFromImage(img string) (*armcompute.ImageReference, error) {
|
||||
}
|
||||
|
||||
// expecting image to not be a marketplace image
|
||||
if strings.HasPrefix(img, "/CommunityGalleries") {
|
||||
if strings.HasPrefix(strings.ToLower(img), "/communitygalleries") {
|
||||
ref.CommunityGalleryImageID = to.Ptr(img)
|
||||
} else {
|
||||
ref.ID = to.Ptr(img)
|
||||
|
@ -49,13 +49,13 @@ func TestGetScalingGroupImage(t *testing.T) {
|
||||
VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{
|
||||
StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{
|
||||
ImageReference: &armcompute.ImageReference{
|
||||
CommunityGalleryImageID: to.Ptr("/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
||||
CommunityGalleryImageID: to.Ptr("/communityGalleries/gallery-name/Images/image-name/Versions/1.2.3"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
wantImage: "/CommunityGalleries/gallery-name/Images/image-name/Versions/1.2.3",
|
||||
wantImage: "/communityGalleries/gallery-name/Images/image-name/Versions/1.2.3",
|
||||
},
|
||||
"splitting scalingGroupID fails": {
|
||||
scalingGroupID: "invalid",
|
||||
@ -299,8 +299,8 @@ func TestImageReferenceFromImage(t *testing.T) {
|
||||
wantID: to.Ptr("/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/constellation-images/providers/Microsoft.Compute/galleries/Constellation/images/constellation/versions/1.5.0"),
|
||||
},
|
||||
"Community": {
|
||||
img: "/CommunityGalleries/ConstellationCVM-728bd310-e898-4450-a1ed-21cf2fb0d735/Images/feat-azure-cvm-sharing/Versions/2022.0826.084922",
|
||||
wantCommunityID: to.Ptr("/CommunityGalleries/ConstellationCVM-728bd310-e898-4450-a1ed-21cf2fb0d735/Images/feat-azure-cvm-sharing/Versions/2022.0826.084922"),
|
||||
img: "/communityGalleries/ConstellationCVM-728bd310-e898-4450-a1ed-21cf2fb0d735/Images/feat-azure-cvm-sharing/Versions/2022.0826.084922",
|
||||
wantCommunityID: to.Ptr("/communityGalleries/ConstellationCVM-728bd310-e898-4450-a1ed-21cf2fb0d735/Images/feat-azure-cvm-sharing/Versions/2022.0826.084922"),
|
||||
},
|
||||
"Marketplace": {
|
||||
img: "constellation-marketplace-image://Azure?offer=constellation&publisher=edgelesssystems&sku=constellation&version=1.2.3",
|
||||
|
Loading…
Reference in New Issue
Block a user