For images that don't have a "latest" tag (such as `google/debian`) we
fetch all the tags when the `ImageCard` component mounts and set the
chosen tag to the first one in the list (so far it seems to be the
latest tag where such a tag exists but we can add some logic here to
choose a appropriate tag if we want).
Signed-off-by: Kristján Oddsson <koddsson@gmail.com>
The error message is actually a object and not a string so we format it
a bit better with this patch.
Signed-off-by: Kristján Oddsson <koddsson@gmail.com>
When a container is first started and the image is downloading there is
no id set. With this patch we'll check if the container has a id and
and is downloading, if so we'll substitute it with the image name and
render such.
This will fix the react key props warning in the developer console as
well as maybe give us some sort of performance boost(?)
Signed-off-by: Kristján Oddsson <koddsson@gmail.com>
Make sure that errors that happen when pulling image layers bubble up to
the UI. We do this by catching errors coming from the docker client,
calling the callback with that error and setting the global variable
`_error` as the error we just caught. This is to make sure that when the
stream ends we call the callback with the error as well as to not to
over-ride it.
Finally we remove the hard-coded message in the UI and display the error
that gets passed in to it through the props attribute. This is the only
part I'm not super sure on if we really want since it must have been set
there for a reason. If I can get a re-producible test case I can make
sure that it's still passing with this patch.
Fixes#355.
Signed-off-by: Kristján Oddsson <koddsson@gmail.com>
Removing the reload (and the whole `componentDidMount` function since
the reload was the only thing in there) makes sure that the container
view isn't reloaded when the DOM changes and so does not make a request
to the container. Because of this change kitematic will not make a
request to the container when hovering over the preference button.
(I wasn't sure if this was used somewhere for real. If it is, I couldn't
find it).
Fixes#333.
Signed-off-by: Kristján Oddsson <koddsson@gmail.com>