Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d5e695b7
Commit
d5e695b7
authored
Feb 28, 2019
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Azure Container Registry anonymous repo support
apply fix for msi and fix test failure
parent
9e71ab4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
azure_credentials.go
pkg/credentialprovider/azure/azure_credentials.go
+7
-0
azure_credentials_test.go
pkg/credentialprovider/azure/azure_credentials_test.go
+4
-4
No files found.
pkg/credentialprovider/azure/azure_credentials.go
View file @
d5e695b7
...
@@ -206,6 +206,13 @@ func (a *acrProvider) Provide() credentialprovider.DockerConfig {
...
@@ -206,6 +206,13 @@ func (a *acrProvider) Provide() credentialprovider.DockerConfig {
cfg
[
url
]
=
*
cred
cfg
[
url
]
=
*
cred
}
}
}
}
// add ACR anonymous repo support: use empty username and password for anonymous access
cfg
[
"*.azurecr.*"
]
=
credentialprovider
.
DockerConfigEntry
{
Username
:
""
,
Password
:
""
,
Email
:
dummyRegistryEmail
,
}
return
cfg
return
cfg
}
}
...
...
pkg/credentialprovider/azure/azure_credentials_test.go
View file @
d5e695b7
...
@@ -76,14 +76,14 @@ func Test(t *testing.T) {
...
@@ -76,14 +76,14 @@ func Test(t *testing.T) {
creds
:=
provider
.
Provide
()
creds
:=
provider
.
Provide
()
if
len
(
creds
)
!=
len
(
result
)
{
if
len
(
creds
)
!=
len
(
result
)
+
1
{
t
.
Errorf
(
"Unexpected list: %v, expected length %d"
,
creds
,
len
(
result
))
t
.
Errorf
(
"Unexpected list: %v, expected length %d"
,
creds
,
len
(
result
)
+
1
)
}
}
for
_
,
cred
:=
range
creds
{
for
_
,
cred
:=
range
creds
{
if
cred
.
Username
!=
"foo"
{
if
cred
.
Username
!=
"
"
&&
cred
.
Username
!=
"
foo"
{
t
.
Errorf
(
"expected 'foo' for username, saw: %v"
,
cred
.
Username
)
t
.
Errorf
(
"expected 'foo' for username, saw: %v"
,
cred
.
Username
)
}
}
if
cred
.
Password
!=
"bar"
{
if
cred
.
Password
!=
"
"
&&
cred
.
Password
!=
"
bar"
{
t
.
Errorf
(
"expected 'bar' for password, saw: %v"
,
cred
.
Username
)
t
.
Errorf
(
"expected 'bar' for password, saw: %v"
,
cred
.
Username
)
}
}
}
}
...
...
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