Skip to content

Commit 97ac5a8

Browse files
Merge branch 'main' into bugfix/crane_flatten_timestamp
2 parents 3094932 + d0099a1 commit 97ac5a8

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

cmd/gcrane/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM gcr.io/distroless/static-debian12:nonroot
2+
COPY gcrane /usr/local/bin/gcrane
3+
ENTRYPOINT ["/usr/local/bin/gcrane"]

hack/presubmit.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,9 @@ set -o pipefail
2020

2121
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
2222

23-
# We can't install in the current directory without changing the current module.
24-
TMP_DIR="$(mktemp -d)"
25-
export PATH="${PATH}:${TMP_DIR}/bin"
26-
export GOPATH="${TMP_DIR}"
27-
pushd ${TMP_DIR}
28-
trap popd EXIT
29-
go install honnef.co/go/tools/cmd/staticcheck@latest
30-
popd
31-
3223
pushd ${PROJECT_ROOT}
3324
trap popd EXIT
3425

35-
staticcheck ./pkg/...
36-
3726
# Verify that all source files are correctly formatted.
3827
find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -e -l
3928

pkg/v1/daemon/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (i *image) computeImageConfig(config *specs.DockerOCIImageConfig) v1.Config
312312
User: config.User,
313313
Volumes: config.Volumes,
314314
WorkingDir: config.WorkingDir,
315-
//lint:ignore SA1019 this is erroneously deprecated, as windows uses it
315+
//nolint:staticcheck // SA1019 this is erroneously deprecated, as windows uses it
316316
ArgsEscaped: config.ArgsEscaped,
317317
StopSignal: config.StopSignal,
318318
Shell: config.Shell,

pkg/v1/remote/options.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,14 @@ func makeOptions(opts ...Option) (*options, error) {
162162
o.transport = transport.NewLogger(o.transport)
163163
}
164164

165+
// Using customized retry predicate if provided, and fallback to default if not.
166+
predicate := o.retryPredicate
167+
if predicate == nil {
168+
predicate = defaultRetryPredicate
169+
}
170+
165171
// Wrap the transport in something that can retry network flakes.
166-
o.transport = transport.NewRetry(o.transport, transport.WithRetryPredicate(defaultRetryPredicate), transport.WithRetryStatusCodes(o.retryStatusCodes...))
172+
o.transport = transport.NewRetry(o.transport, transport.WithRetryPredicate(predicate), transport.WithRetryStatusCodes(o.retryStatusCodes...))
167173

168174
// Wrap this last to prevent transport.New from double-wrapping.
169175
if o.userAgent != "" {

pkg/v1/remote/transport/error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
// Error implements error to support the following error specification:
28-
// https://github.com/docker/distribution/blob/master/docs/spec/api.md#errors
28+
// https://github.com/distribution/distribution/blob/aac2f6c8b7c5a6c60190848bab5cbeed2b5ba0a9/docs/spec/api.md#errors
2929
type Error struct {
3030
Errors []Diagnostic `json:"errors,omitempty"`
3131
// The http status code returned.
@@ -111,7 +111,7 @@ func (d Diagnostic) String() string {
111111
type ErrorCode string
112112

113113
// The set of error conditions a registry may return:
114-
// https://github.com/docker/distribution/blob/master/docs/spec/api.md#errors-2
114+
// https://github.com/distribution/distribution/blob/aac2f6c8b7c5a6c60190848bab5cbeed2b5ba0a9/docs/spec/api.md#errors-2
115115
const (
116116
BlobUnknownErrorCode ErrorCode = "BLOB_UNKNOWN"
117117
BlobUploadInvalidErrorCode ErrorCode = "BLOB_UPLOAD_INVALID"
@@ -170,7 +170,7 @@ func CheckError(resp *http.Response, codes ...int) error {
170170
}
171171

172172
func makeError(resp *http.Response, body []byte) *Error {
173-
// https://github.com/docker/distribution/blob/master/docs/spec/api.md#errors
173+
// https://github.com/distribution/distribution/blob/aac2f6c8b7c5a6c60190848bab5cbeed2b5ba0a9/docs/spec/api.md#errors
174174
structuredError := &Error{}
175175

176176
// This can fail if e.g. the response body is not valid JSON. That's fine,

0 commit comments

Comments
 (0)