CreateImageWizard: use non-deprecated image type aliases

'ami' was deprecated a while ago, and is kept around as an alias of
'aws'. Same with 'vhd' and 'azure', and 'vhd' and 'gcp'.

This maintains support for the old aliases where necessary.
This commit is contained in:
Sanne Raymaekers 2022-12-05 14:25:40 +01:00
parent dd08069e48
commit cb8ab9347e
8 changed files with 24 additions and 18 deletions

View file

@ -77,7 +77,7 @@ const onSave = (values) => {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {
@ -136,7 +136,7 @@ const onSave = (values) => {
image_requests: [
{
architecture: 'x86_64',
image_type: 'vhd',
image_type: 'azure',
upload_request: {
type: 'azure',
options: {

View file

@ -95,7 +95,10 @@ export const ImageBuildStatus = ({ imageId }) => {
};
let status;
if (image.imageType === 'aws') {
if (
!image.isClone &&
(image.imageType === 'aws' || image.imageType === 'ami')
) {
const imageStatuses = useSelector((state) =>
selectImageStatusesById(state, image.id)
);

View file

@ -68,7 +68,10 @@ const ImageLink = ({ imageId, isExpired, isInClonesTable }) => {
if (!uploadStatus) return null;
if (hasProvisioning && image.imageType === 'ami') {
if (
hasProvisioning &&
(image.imageType === 'aws' || image.imageType === 'ami')
) {
return (
<ProvisioningLink
imageId={image.id}

View file

@ -41,7 +41,7 @@ export const selectCloneById = (state, cloneId) => {
status: clone.image_status?.status,
uploadStatus: clone.image_status?.upload_status,
parent: clone.parent,
imageType: 'ami',
imageType: 'aws',
isClone: true,
};
} else {

View file

@ -1617,7 +1617,7 @@ describe('Click through all steps', () => {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {
@ -1701,7 +1701,7 @@ describe('Click through all steps', () => {
image_requests: [
{
architecture: 'x86_64',
image_type: 'vhd',
image_type: 'azure',
upload_request: {
type: 'azure',
options: {

View file

@ -31,7 +31,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {
@ -51,7 +51,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'vhd',
image_type: 'gcp',
upload_request: {
type: 'gcp',
options: {
@ -70,7 +70,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},
@ -87,7 +87,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},
@ -104,7 +104,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},
@ -121,7 +121,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},
@ -138,7 +138,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},
@ -155,7 +155,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'vhd',
image_type: 'gcp',
upload_request: {
type: 'gcp',
options: {
@ -174,7 +174,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'vhd',
image_type: 'azure',
upload_request: {
type: 'azure',
options: {},

View file

@ -22,7 +22,7 @@ const mockComposes = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {

View file

@ -7,7 +7,7 @@ const compose = {
image_requests: [
{
architecture: 'x86_64',
image_type: 'ami',
image_type: 'aws',
upload_request: {
type: 'aws',
options: {},