allow to access oci repos without auth (#1711)
* allow to access oci repos without auth Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
		
							parent
							
								
									14a83e7cbe
								
							
						
					
					
						commit
						8ed8a9eab3
					
				|  | @ -385,10 +385,9 @@ func (st *HelmState) SyncRepos(helm RepoUpdater, shouldSkip map[string]bool) ([] | ||||||
| 		var err error | 		var err error | ||||||
| 		if repo.OCI { | 		if repo.OCI { | ||||||
| 			username, password := gatherOCIUsernamePassword(repo.Name, repo.Username, repo.Password) | 			username, password := gatherOCIUsernamePassword(repo.Name, repo.Username, repo.Password) | ||||||
| 			if username == "" || password == "" { | 			if username != "" && password != "" { | ||||||
| 				return nil, fmt.Errorf("username and password are required fields for logging in to OCI registries with helm") | 				err = helm.RegistryLogin(repo.URL, username, password) | ||||||
| 			} | 			} | ||||||
| 			err = helm.RegistryLogin(repo.URL, username, password) |  | ||||||
| 		} else { | 		} else { | ||||||
| 			err = helm.AddRepo(repo.Name, repo.URL, repo.CaFile, repo.CertFile, repo.KeyFile, repo.Username, repo.Password, repo.Managed) | 			err = helm.AddRepo(repo.Name, repo.URL, repo.CaFile, repo.CertFile, repo.KeyFile, repo.Username, repo.Password, repo.Managed) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue