Merge remote-tracking branch 'upstream/new-ui-with-sync-image' into author

This commit is contained in:
wemeya 2016-06-24 10:50:35 +08:00
commit fa928d1abc

View File

@ -17,6 +17,7 @@ package replication
import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
@ -190,7 +191,16 @@ func (c *Checker) projectExist() (exist, canWrite bool, err error) {
}
req.SetBasicAuth(c.dstUsr, c.dstPwd)
resp, err := http.DefaultClient.Do(req)
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: c.insecure,
},
},
}
resp, err := client.Do(req)
if err != nil {
return
}
@ -259,12 +269,26 @@ func (c *Checker) createProject() error {
}
req.SetBasicAuth(c.dstUsr, c.dstPwd)
resp, err := http.DefaultClient.Do(req)
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: c.insecure,
},
},
}
resp, err := client.Do(req)
if err != nil {
return err
}
if resp.StatusCode != http.StatusCreated {
// version 0.1.1's reponse code is 200
if resp.StatusCode == http.StatusCreated ||
resp.StatusCode == http.StatusOK {
return nil
}
if resp.StatusCode == http.StatusConflict {
return ErrConflict
}
@ -279,9 +303,6 @@ func (c *Checker) createProject() error {
c.project, c.dstURL, c.dstUsr, resp.StatusCode, string(message))
}
return nil
}
// ManifestPuller pulls the manifest of a tag. And if no tag needs to be pulled,
// the next state that state machine should enter is "finished".
type ManifestPuller struct {