Skip to content

Commit

Permalink
fix Context issue
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Chen <chen8132@gmail.com>
  • Loading branch information
Shawnpku committed Mar 4, 2019
1 parent ae91d1f commit 3390f32
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 24 deletions.
5 changes: 3 additions & 2 deletions registry/storage/driver/middleware/alicdn/middleware.go
@@ -1,12 +1,13 @@
package middleware

import (
"context"
"fmt"
"net/url"
"strings"
"time"

"github.com/docker/distribution/context"
dcontext "github.com/docker/distribution/context"
storagedriver "github.com/docker/distribution/registry/storage/driver"
storagemiddleware "github.com/docker/distribution/registry/storage/driver/middleware"

Expand Down Expand Up @@ -99,7 +100,7 @@ func newAliCDNStorageMiddleware(storageDriver storagedriver.StorageDriver, optio
func (ac *aliCDNStorageMiddleware) URLFor(ctx context.Context, path string, options map[string]interface{}) (string, error) {

if ac.StorageDriver.Name() != "oss" {
context.GetLogger(ctx).Warn("the AliCDN middleware does not support this backend storage driver")
dcontext.GetLogger(ctx).Warn("the AliCDN middleware does not support this backend storage driver")
return ac.StorageDriver.URLFor(ctx, path, options)
}
acURL, err := ac.urlSigner.Sign(ac.baseURL+path, time.Now().Add(ac.duration))
Expand Down
97 changes: 97 additions & 0 deletions vendor/github.com/denverdino/aliyungo/cdn/auth/random_uuid.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions vendor/github.com/denverdino/aliyungo/cdn/auth/sign_url.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion vendor/github.com/denverdino/aliyungo/oss/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 33 additions & 15 deletions vendor/github.com/denverdino/aliyungo/oss/signature.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 33 additions & 6 deletions vendor/github.com/denverdino/aliyungo/util/util.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3390f32

Please sign in to comment.