mirror of
https://github.com/helm/helm.git
synced 2026-08-04 15:10:47 +00:00
ref(pkg/storage): Refactor Deployed and DeployedAll (#7374)
The error returned from DeployedAll will never contain "not found". The error returned at the end of Deployed is already known to be nil, and we never want to return ls[0] together with a non-nil error anyway. Signed-off-by: Simon Alling <alling.simon@gmail.com>
This commit is contained in:
committed by
Martin Hickey
parent
e84b61b2db
commit
e868cb23c0
@@ -112,9 +112,6 @@ func (s *Storage) ListDeployed() ([]*rspb.Release, error) {
|
||||
func (s *Storage) Deployed(name string) (*rspb.Release, error) {
|
||||
ls, err := s.DeployedAll(name)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "not found") {
|
||||
return nil, errors.Errorf("%q has no deployed releases", name)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -122,7 +119,7 @@ func (s *Storage) Deployed(name string) (*rspb.Release, error) {
|
||||
return nil, errors.Errorf("%q has no deployed releases", name)
|
||||
}
|
||||
|
||||
return ls[0], err
|
||||
return ls[0], nil
|
||||
}
|
||||
|
||||
// DeployedAll returns all deployed releases with the provided name, or
|
||||
|
||||
Reference in New Issue
Block a user