Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover a couple special paths in keychain unit tests. #1302

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

mattmoor
Copy link
Collaborator

Looks like it works. 馃憤

@imjasonh imjasonh merged commit dd8d514 into google:main Feb 23, 2022
@dprotaso
Copy link
Contributor

dprotaso commented Feb 23, 2022

This throws me off

var cfg, empty types.AuthConfig
for _, key := range []string{
target.String(),
target.RegistryStr(),
} {
if key == name.DefaultRegistry {
key = DefaultAuthKey
}
cfg, err = cf.GetAuthConfig(key)
if err != nil {
return nil, err
}
if cfg != empty {
break
}
}

Since the test for repos uses a config file that doesn't have schemes

}, {
desc: "valid config file; matches repo",
target: testRepo,
content: fmt.Sprintf(`{
"auths": {
"test.io/my-repo": {"auth": %q},
"test.io/another-repo": {"auth": %q},
"test.io": {"auth": %q}
}

But I think the the scheme should be present - hence my K8S PR - #1299

@dprotaso
Copy link
Contributor

dprotaso commented Feb 23, 2022

So my ./.dockerconfig has

{
  "https://gcr.io": {...},
  "https://us.gcr.io": {...},
  ...
}

But my /.docker/config.json has

{
	"auths": {
		"https://index.docker.io/v1/": {},
		"registry.gitlab.com": {}
	},
	"credsStore": "desktop",
	"credHelpers": {
		"asia.gcr.io": "gcloud",
		"eu.gcr.io": "gcloud",
		"gcr.io": "gcloud",
		"marketplace.gcr.io": "gcloud",
		"staging-k8s.gcr.io": "gcloud",
		"us.gcr.io": "gcloud"
	}
}

@dprotaso
Copy link
Contributor

dprotaso commented Feb 23, 2022

looks like the docker code handles the scheme properly 馃帀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants