fix(helm): change repo.GetURL function name

Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
pull/10406/head
Felipe Santos 3 years ago
parent 800f8c4afb
commit 2cb6183561

@ -94,8 +94,8 @@ func (r *File) Get(name string) *Entry {
return nil
}
// Get returns an entry with the given URL if it exists, otherwise returns nil
func (r *File) GetURL(url string) *Entry {
// GetRepoFromURL returns an entry with the given URL if it exists, otherwise returns nil
func (r *File) GetRepoFromURL(url string) *Entry {
for _, entry := range r.Repositories {
if entry.URL == url {
return entry
@ -109,7 +109,7 @@ func FindRepoEntry(url string, repositoryConfig string) (*Entry, error) {
if err != nil {
return nil, err
}
entry := f.GetURL(url)
entry := f.GetRepoFromURL(url)
if entry == nil {
return nil, nil
}

@ -128,7 +128,7 @@ func TestRepoFile_Get(t *testing.T) {
}
}
func TestRepoFile_GetURL(t *testing.T) {
func TestGetRepoFromURL(t *testing.T) {
repo := NewFile()
repo.Add(
&Entry{
@ -151,7 +151,7 @@ func TestRepoFile_GetURL(t *testing.T) {
url := "https://example.com/second"
entry := repo.GetURL(url)
entry := repo.GetRepoFromURL(url)
if entry == nil {
t.Fatalf("Expected repo entry %q to be found", url)
}
@ -160,7 +160,7 @@ func TestRepoFile_GetURL(t *testing.T) {
t.Errorf("Expected repo Name to be %q but got %q", "second", entry.Name)
}
entry = repo.GetURL("http://nonexistent.example.com/nonexistent")
entry = repo.GetRepoFromURL("http://nonexistent.example.com/nonexistent")
if entry != nil {
t.Errorf("Got unexpected entry %+v", entry)
}

Loading…
Cancel
Save