Skip to content

Commit fea8313

Browse files
marie-jjleveugle
authored andcommitted
fix(pci.instances): allow to create instance from a backup image
1 parent de8c71b commit fea8313

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/manager/modules/pci/src/components/project/images-list/images.class.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export default class Image {
3232
return includes(ACTIVE_STATUS, this.status);
3333
}
3434

35+
isBackup() {
36+
return this.planCode === 'snapshot.consumption';
37+
}
38+
3539
getApplications() {
3640
return xor(this.tags, [APPLICATION_TAG]);
3741
}

packages/manager/modules/pci/src/projects/project/instances/add/add.controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ export default class PciInstancesAddController {
120120

121121
onImageChange() {
122122
this.displaySelectedImage = true;
123-
this.instance.imageId = this.model.image.getIdByRegion(this.instance.region);
123+
if (this.model.image.isBackup()) {
124+
this.instance.imageId = this.model.image.id;
125+
} else {
126+
this.instance.imageId = this.model.image.getIdByRegion(this.instance.region);
127+
}
124128
this.flavor = this.model.flavorGroup.getFlavorByOsType(this.model.image.type);
125129

126130
this.instance.flavorId = this.model.flavorGroup.getFlavorId(

0 commit comments

Comments
 (0)