Signed-off-by: Antonio Murdaca <runcom@redhat.com>
| ... | ... |
@@ -49,7 +49,7 @@ clone git github.com/boltdb/bolt v1.2.0 |
| 49 | 49 |
clone git github.com/miekg/dns 75e6e86cc601825c5dbcd4e0c209eab180997cd7 |
| 50 | 50 |
|
| 51 | 51 |
# get graph and distribution packages |
| 52 |
-clone git github.com/docker/distribution 467fc068d88aa6610691b7f1a677271a3fac4aac |
|
| 52 |
+clone git github.com/docker/distribution 9ec0d742d69f77caa4dd5f49ceb70c3067d39f30 |
|
| 53 | 53 |
clone git github.com/vbatts/tar-split v0.9.11 |
| 54 | 54 |
|
| 55 | 55 |
# get desired notary commit, might also need to be updated in Dockerfile |
| ... | ... |
@@ -110,7 +110,8 @@ func (mb *configManifestBuilder) Build(ctx context.Context) (m distribution.Mani |
| 110 | 110 |
ContainerConfig struct {
|
| 111 | 111 |
Cmd []string |
| 112 | 112 |
} `json:"container_config,omitempty"` |
| 113 |
- ThrowAway bool `json:"throwaway,omitempty"` |
|
| 113 |
+ Author string `json:"author,omitempty"` |
|
| 114 |
+ ThrowAway bool `json:"throwaway,omitempty"` |
|
| 114 | 115 |
} |
| 115 | 116 |
|
| 116 | 117 |
fsLayerList := make([]FSLayer, len(img.History)) |
| ... | ... |
@@ -145,6 +146,7 @@ func (mb *configManifestBuilder) Build(ctx context.Context) (m distribution.Mani |
| 145 | 145 |
Parent: parent, |
| 146 | 146 |
Comment: h.Comment, |
| 147 | 147 |
Created: h.Created, |
| 148 |
+ Author: h.Author, |
|
| 148 | 149 |
} |
| 149 | 150 |
v1Compatibility.ContainerConfig.Cmd = []string{img.History[i].CreatedBy}
|
| 150 | 151 |
if h.EmptyLayer {
|
| ... | ... |
@@ -63,6 +63,19 @@ var ( |
| 63 | 63 |
Description: "Returned when a service is not available", |
| 64 | 64 |
HTTPStatusCode: http.StatusServiceUnavailable, |
| 65 | 65 |
}) |
| 66 |
+ |
|
| 67 |
+ // ErrorCodeTooManyRequests is returned if a client attempts too many |
|
| 68 |
+ // times to contact a service endpoint. |
|
| 69 |
+ ErrorCodeTooManyRequests = Register("errcode", ErrorDescriptor{
|
|
| 70 |
+ Value: "TOOMANYREQUESTS", |
|
| 71 |
+ Message: "too many requests", |
|
| 72 |
+ Description: `Returned when a client attempts to contact a |
|
| 73 |
+ service too many times`, |
|
| 74 |
+ // FIXME: go1.5 doesn't export http.StatusTooManyRequests while |
|
| 75 |
+ // go1.6 does. Update the hardcoded value to the constant once |
|
| 76 |
+ // Docker updates golang version to 1.6. |
|
| 77 |
+ HTTPStatusCode: 429, |
|
| 78 |
+ }) |
|
| 66 | 79 |
) |
| 67 | 80 |
|
| 68 | 81 |
var nextCode = 1000 |
| ... | ... |
@@ -51,10 +51,17 @@ func parseHTTPErrorResponse(statusCode int, r io.Reader) error {
|
| 51 | 51 |
} |
| 52 | 52 |
err = json.Unmarshal(body, &detailsErr) |
| 53 | 53 |
if err == nil && detailsErr.Details != "" {
|
| 54 |
- if statusCode == http.StatusUnauthorized {
|
|
| 54 |
+ switch statusCode {
|
|
| 55 |
+ case http.StatusUnauthorized: |
|
| 55 | 56 |
return errcode.ErrorCodeUnauthorized.WithMessage(detailsErr.Details) |
| 57 |
+ // FIXME: go1.5 doesn't export http.StatusTooManyRequests while |
|
| 58 |
+ // go1.6 does. Update the hardcoded value to the constant once |
|
| 59 |
+ // Docker updates golang version to 1.6. |
|
| 60 |
+ case 429: |
|
| 61 |
+ return errcode.ErrorCodeTooManyRequests.WithMessage(detailsErr.Details) |
|
| 62 |
+ default: |
|
| 63 |
+ return errcode.ErrorCodeUnknown.WithMessage(detailsErr.Details) |
|
| 56 | 64 |
} |
| 57 |
- return errcode.ErrorCodeUnknown.WithMessage(detailsErr.Details) |
|
| 58 | 65 |
} |
| 59 | 66 |
|
| 60 | 67 |
if err := json.Unmarshal(body, &errors); err != nil {
|