@@ -45,7 +45,7 @@ func (graph *Graph) getRemoteHistory(imgId, registry string, token []string) ([]
4545 if err != nil {
4646 return nil , err
4747 }
48- req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
48+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
4949 res , err := client .Do (req )
5050 if err != nil || res .StatusCode != 200 {
5151 if res != nil {
@@ -90,7 +90,7 @@ func (graph *Graph) LookupRemoteImage(imgId, registry string, authConfig *auth.A
9090}
9191
9292func (graph * Graph ) getImagesInRepository (repository string , authConfig * auth.AuthConfig ) ([]map [string ]string , error ) {
93- u := INDEX_ENDPOINT + "/repositories/" + repository + "/images"
93+ u := INDEX_ENDPOINT + "/repositories/" + repository + "/images"
9494 req , err := http .NewRequest ("GET" , u , nil )
9595 if err != nil {
9696 return nil , err
@@ -131,7 +131,7 @@ func (graph *Graph) getRemoteImage(stdout io.Writer, imgId, registry string, tok
131131 if err != nil {
132132 return nil , nil , fmt .Errorf ("Failed to download json: %s" , err )
133133 }
134- req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
134+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
135135 res , err := client .Do (req )
136136 if err != nil {
137137 return nil , nil , fmt .Errorf ("Failed to download json: %s" , err )
@@ -158,7 +158,7 @@ func (graph *Graph) getRemoteImage(stdout io.Writer, imgId, registry string, tok
158158 if err != nil {
159159 return nil , nil , fmt .Errorf ("Error while getting from the server: %s\n " , err )
160160 }
161- req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
161+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
162162 res , err = client .Do (req )
163163 if err != nil {
164164 return nil , nil , err
@@ -174,7 +174,7 @@ func (graph *Graph) getRemoteTags(stdout io.Writer, registries []string, reposit
174174 if err != nil {
175175 return nil , err
176176 }
177- req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
177+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
178178 res , err := client .Do (req )
179179 defer res .Body .Close ()
180180 if err != nil || (res .StatusCode != 200 && res .StatusCode != 404 ) {
@@ -209,7 +209,7 @@ func (graph *Graph) getImageForTag(stdout io.Writer, tag, remote, registry strin
209209 if err != nil {
210210 return "" , err
211211 }
212- req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
212+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , ", " ))
213213 res , err := client .Do (req )
214214 if err != nil {
215215 return "" , fmt .Errorf ("Error while retrieving repository info: %v" , err )
@@ -357,7 +357,7 @@ func pushImageRec(graph *Graph, stdout io.Writer, img *Image, registry string, t
357357 return err
358358 }
359359 req .Header .Add ("Content-type" , "application/json" )
360- req .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
360+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
361361
362362 checksum , err := img .Checksum ()
363363 if err != nil {
@@ -403,7 +403,7 @@ func pushImageRec(graph *Graph, stdout io.Writer, img *Image, registry string, t
403403
404404 req3 .ContentLength = - 1
405405 req3 .TransferEncoding = []string {"chunked" }
406- req3 .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
406+ req3 .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
407407 res3 , err := doWithCookies (client , req3 )
408408 if err != nil {
409409 return fmt .Errorf ("Failed to upload layer: %s" , err )
@@ -442,7 +442,7 @@ func (graph *Graph) pushTag(remote, revision, tag, registry string, token []stri
442442 return err
443443 }
444444 req .Header .Add ("Content-type" , "application/json" )
445- req .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
445+ req .Header .Set ("Authorization" , "Token " + strings .Join (token , "," ))
446446 req .ContentLength = int64 (len (revision ))
447447 res , err := doWithCookies (client , req )
448448 if err != nil {
@@ -493,7 +493,6 @@ func (graph *Graph) PushRepository(stdout io.Writer, remote string, localRepo Re
493493 return fmt .Errorf ("Error occured while fetching the list: %v" , err )
494494 }
495495
496-
497496 // Filter list to only send images/checksums not already uploaded
498497 i := 0
499498 for _ , obj := range checksums {
0 commit comments