File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/cli-v3/src/commands Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -757,13 +757,22 @@ async function initializeOrAttachDeployment(
757757 ) ;
758758 }
759759
760- const { imageReference } = existingDeploymentOrError . data ;
760+ const { imageReference, status } = existingDeploymentOrError . data ;
761761 if ( ! imageReference ) {
762762 // this is just an artifact of our current DB schema
763763 // `imageReference` is stored as nullable, but it should always exist
764764 throw new Error ( "Existing deployment does not have an image reference" ) ;
765765 }
766766
767+ if (
768+ status === "CANCELED" ||
769+ status === "FAILED" ||
770+ status === "TIMED_OUT" ||
771+ status === "DEPLOYED"
772+ ) {
773+ throw new Error ( `Existing deployment is in unexpected state: ${ status } ` ) ;
774+ }
775+
767776 return {
768777 ...existingDeploymentOrError . data ,
769778 imageTag : imageReference ,
You can’t perform that action at this time.
0 commit comments