Merge pull request #47 from arapulido/fix_crash_when_config_file_is_empty

If the hyper config file is not set, the AuthConfig should be empty
This commit is contained in:
Harry Zhang
2018-01-01 19:55:58 +08:00
committed by GitHub

View File

@@ -333,8 +333,10 @@ func (p *HyperProvider) ensureImage(image string) error {
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registry.ParseRepositoryInfo(distributionRef)
authConfig := p.resolveAuthConfig(p.configFile.AuthConfigs, repoInfo.Index)
var authConfig types.AuthConfig
if p.configFile != nil {
authConfig = p.resolveAuthConfig(p.configFile.AuthConfigs, repoInfo.Index)
}
encodedAuth, err := p.encodeAuthToBase64(authConfig)
if err != nil {
return err