Skip to content

Commit

Permalink
Fix helmrepo sync.Map load assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroPower committed Mar 4, 2025
1 parent 5de21b9 commit 9097ea1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/helmrepo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@ func (m *Manager) Get(repo string) (*Repo, error) {
// [Manager], an error is returned.
func (m *Manager) GetByName(name string) (*Repo, error) {
if repo, ok := m.reposByName.Load(name); ok {
return repo.(*Repo), nil
rr, ok := repo.(*Repo)
if !ok {
panic(fmt.Sprintf("repo with name %q is not a *Repo", name))
}

return rr, nil
}

return nil, RepoNotFoundError{Name: name}
Expand Down

0 comments on commit 9097ea1

Please sign in to comment.