Handle all valid image_status.status values

osbuild-composer and as a result also Image Builder are returning an
invalid `image_status.status` value "running" for composes which are in
progress.

Extend the front-end to handle all valid `image_status.status` values,
specifically also "building", "uploading" and "registering". Also keep
support for the invalid value "running" for some time to ensure backward
compatibility with older osbuild-composer versions.

Modify test cases in `ImagesTable.test.js` to verify all possible
`image_status.status` values. Also modify the `image_status` values used
for testing to what is actually returned by osbuild-composer Cloud API
and as a result also by Image Builder's API.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-03-24 16:38:56 +01:00 committed by Tomas Hozza
parent 782d6c684c
commit 4777cdac76
2 changed files with 122 additions and 8 deletions

View file

@ -26,6 +26,7 @@ const ImageBuildStatus = (props) => {
text: 'Image build, Upload, Cloud registration pending'
}
],
// Keep "running" for backward compatibility
running: [
{
icon: <Spinner size="md" />,
@ -35,6 +36,44 @@ const ImageBuildStatus = (props) => {
icon: <PendingIcon />,
text: 'Upload, Cloud registration pending'
}
],
building: [
{
icon: <Spinner size="md" />,
text: 'Image build in progress'
},
{
icon: <PendingIcon />,
text: 'Upload, Cloud registration pending'
}
],
uploading: [
{
icon: <CheckCircleIcon />,
text: 'Image build finished'
},
{
icon: <Spinner size="md" />,
text: 'Image upload in progress'
},
{
icon: <PendingIcon />,
text: 'Cloud registration pending'
}
],
registering: [
{
icon: <CheckCircleIcon />,
text: 'Image build finished'
},
{
icon: <CheckCircleIcon />,
text: 'Image upload finished'
},
{
icon: <Spinner size="md" />,
text: 'Cloud registration in progress'
}
]
};
return (