Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
9b63bed6
Unverified
Kaydet (Commit)
9b63bed6
authored
Tem 15, 2016
tarafından
Keerthan Reddy Mala
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add optional auth config to docker push
Signed-off-by:
Keerthan Reddy Mala
<
kmala@deis.com
>
üst
01cb9692
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
image.py
docker/api/image.py
+17
-10
api.md
docs/api.md
+2
-0
No files found.
docker/api/image.py
Dosyayı görüntüle @
9b63bed6
...
...
@@ -205,7 +205,7 @@ class ImageApiMixin(object):
return
self
.
_result
(
response
)
def
push
(
self
,
repository
,
tag
=
None
,
stream
=
False
,
insecure_registry
=
False
,
decode
=
False
):
insecure_registry
=
False
,
auth_config
=
None
,
decode
=
False
):
if
insecure_registry
:
warnings
.
warn
(
INSECURE_REGISTRY_DEPRECATION_WARNING
.
format
(
'push()'
),
...
...
@@ -224,15 +224,22 @@ class ImageApiMixin(object):
if
utils
.
compare_version
(
'1.5'
,
self
.
_version
)
>=
0
:
# If we don't have any auth data so far, try reloading the config
# file one more time in case anything showed up in there.
if
not
self
.
_auth_configs
:
self
.
_auth_configs
=
auth
.
load_config
()
authcfg
=
auth
.
resolve_authconfig
(
self
.
_auth_configs
,
registry
)
# Do not fail here if no authentication exists for this specific
# registry as we can have a readonly pull. Just put the header if
# we can.
if
authcfg
:
headers
[
'X-Registry-Auth'
]
=
auth
.
encode_header
(
authcfg
)
if
auth_config
is
None
:
log
.
debug
(
'Looking for auth config'
)
if
not
self
.
_auth_configs
:
log
.
debug
(
"No auth config in memory - loading from filesystem"
)
self
.
_auth_configs
=
auth
.
load_config
()
authcfg
=
auth
.
resolve_authconfig
(
self
.
_auth_configs
,
registry
)
# Do not fail here if no authentication exists for this
# specific registry as we can have a readonly pull. Just
# put the header if we can.
if
authcfg
:
headers
[
'X-Registry-Auth'
]
=
auth
.
encode_header
(
authcfg
)
else
:
log
.
debug
(
'Sending supplied auth config'
)
headers
[
'X-Registry-Auth'
]
=
auth
.
encode_header
(
auth_config
)
response
=
self
.
_post_json
(
u
,
None
,
headers
=
headers
,
stream
=
stream
,
params
=
params
...
...
docs/api.md
Dosyayı görüntüle @
9b63bed6
...
...
@@ -801,6 +801,8 @@ command.
*
tag (str): An optional tag to push
*
stream (bool): Stream the output as a blocking generator
*
insecure_registry (bool): Use
`http://`
to connect to the registry
*
auth_config (dict): Override the credentials that Client.login has set for this request
`auth_config`
should contain the
`username`
and
`password`
keys to be valid.
**Returns**
(generator or str): The output of the upload
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment