Browse code

bump to master

Victor Vieux authored on 2013/06/06 00:30:45
Showing 6 changed files
... ...
@@ -1223,6 +1223,9 @@ func (cli *DockerCli) CmdRun(args ...string) error {
1223 1223
 		return err
1224 1224
 	}
1225 1225
 
1226
+	if !config.AttachStdout && !config.AttachStderr {
1227
+		fmt.Println(out.ID)
1228
+	}
1226 1229
 	if connections > 0 {
1227 1230
 		chErrors := make(chan error, connections)
1228 1231
 		cli.monitorTtySize(out.ID)
... ...
@@ -1257,9 +1260,6 @@ func (cli *DockerCli) CmdRun(args ...string) error {
1257 1257
 			connections -= 1
1258 1258
 		}
1259 1259
 	}
1260
-	if !config.AttachStdout && !config.AttachStderr {
1261
-		fmt.Println(out.ID)
1262
-	}
1263 1260
 	return nil
1264 1261
 }
1265 1262
 
... ...
@@ -1352,7 +1352,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e
1352 1352
 				return err
1353 1353
 			}
1354 1354
 			if m.Progress != "" {
1355
-				fmt.Fprintf(out, "Downloading %s\r", m.Progress)
1355
+				fmt.Fprintf(out, "%s %s\r", m.Status, m.Progress)
1356 1356
 			} else if m.Error != "" {
1357 1357
 				return fmt.Errorf(m.Error)
1358 1358
 			} else {
... ...
@@ -56,7 +56,7 @@ Uses json stream instead of HTML hijack, it looks like this:
56 56
 	   Content-Type: application/json
57 57
 
58 58
 	   {"status":"Pushing..."}
59
-	   {"progress":"1/? (n/a)"}
59
+	   {"status":"Pushing", "progress":"1/? (n/a)"}
60 60
 	   {"error":"Invalid..."}
61 61
 	   ...
62 62
 
... ...
@@ -557,7 +557,7 @@ Create an image
557 557
 	   Content-Type: application/json
558 558
 
559 559
 	   {"status":"Pulling..."}
560
-	   {"progress":"1/? (n/a)"}
560
+	   {"status":"Pulling", "progress":"1/? (n/a)"}
561 561
 	   {"error":"Invalid..."}
562 562
 	   ...
563 563
 
... ...
@@ -591,7 +591,7 @@ Insert a file in a image
591 591
 	   Content-Type: application/json
592 592
 
593 593
 	   {"status":"Inserting..."}
594
-	   {"progress":"1/? (n/a)"}
594
+	   {"status":"Inserting", "progress":"1/? (n/a)"}
595 595
 	   {"error":"Invalid..."}
596 596
 	   ...
597 597
 
... ...
@@ -710,7 +710,7 @@ Push an image on the registry
710 710
 	   Content-Type: application/json
711 711
 
712 712
 	   {"status":"Pushing..."}
713
-	   {"progress":"1/? (n/a)"}
713
+	   {"status":"Pushing", "progress":"1/? (n/a)"}
714 714
 	   {"error":"Invalid..."}
715 715
 	   ...
716 716
 
... ...
@@ -557,7 +557,7 @@ Create an image
557 557
 	   Content-Type: application/json
558 558
 
559 559
 	   {"status":"Pulling..."}
560
-	   {"progress":"1/? (n/a)"}
560
+	   {"status":"Pulling", "progress":"1/? (n/a)"}
561 561
 	   {"error":"Invalid..."}
562 562
 	   ...
563 563
 
... ...
@@ -591,7 +591,7 @@ Insert a file in a image
591 591
 	   Content-Type: application/json
592 592
 
593 593
 	   {"status":"Inserting..."}
594
-	   {"progress":"1/? (n/a)"}
594
+	   {"status":"Inserting", "progress":"1/? (n/a)"}
595 595
 	   {"error":"Invalid..."}
596 596
 	   ...
597 597
 
... ...
@@ -711,7 +711,7 @@ Push an image on the registry
711 711
 	   Content-Type: application/json
712 712
 
713 713
 	   {"status":"Pushing..."}
714
-	   {"progress":"1/? (n/a)"}
714
+	   {"status":"Pushing", "progress":"1/? (n/a)"}
715 715
 	   {"error":"Invalid..."}
716 716
 	   ...
717 717
 
... ...
@@ -573,7 +573,7 @@ func (srv *Server) pushImage(r *registry.Registry, out io.Writer, remote, imgId,
573 573
 	}
574 574
 
575 575
 	// Send the layer
576
-	if err := r.PushImageLayerRegistry(imgData.ID, utils.ProgressReader(layerData, int(layerData.Size), out, sf.FormatProgress("", "%v/%v (%v)"), sf), ep, token); err != nil {
576
+	if err := r.PushImageLayerRegistry(imgData.ID, utils.ProgressReader(layerData, int(layerData.Size), out, sf.FormatProgress("Pushing", "%v/%v (%v)"), sf), ep, token); err != nil {
577 577
 		return err
578 578
 	}
579 579
 	return nil
... ...
@@ -608,7 +608,7 @@ func (sf *StreamFormatter) FormatError(err error) []byte {
608 608
 func (sf *StreamFormatter) FormatProgress(action, str string) []byte {
609 609
 	sf.used = true
610 610
 	if sf.json {
611
-		b, err := json.Marshal(&JSONMessage{Progress:str})
611
+		b, err := json.Marshal(&JSONMessage{Status: action, Progress:str})
612 612
 		if err != nil {
613 613
                         return nil
614 614
                 }