Browse Source

Merge pull request #12417 from hashneo/patch-1

What if authConfig or factory is Nill?
Jessie Frazelle 10 năm trước cách đây
mục cha
commit
6b8d8a5847
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      registry/session.go

+ 1 - 1
registry/session.go

@@ -54,7 +54,7 @@ func NewSession(authConfig *cliconfig.AuthConfig, factory *requestdecorator.Requ
 		if err != nil {
 			return nil, err
 		}
-		if info.Standalone {
+		if info.Standalone && authConfig != nil && factory != nil {
 			logrus.Debugf("Endpoint %s is eligible for private registry. Enabling decorator.", r.indexEndpoint.String())
 			dec := requestdecorator.NewAuthDecorator(authConfig.Username, authConfig.Password)
 			factory.AddDecorator(dec)