Skip to content

Commit

Permalink
Update error when updating volume size (#1545)
Browse files Browse the repository at this point in the history
Signed-off-by: Javier López Barba <javier@okteto.com>
  • Loading branch information
jLopezbarb committed May 18, 2021
1 parent 2b81e10 commit 93062cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmd/stack/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ func deployVolume(ctx context.Context, volumeName string, s *model.Stack, c *kub
}

if err := volumes.Update(ctx, old, c); err != nil {
if strings.Contains(err.Error(), "spec.resources.requests.storage: Forbidden: field can not be less than previous value") {
return fmt.Errorf("error updating volume '%s': Volume size can not be less than previous value", old.Name)
}
return fmt.Errorf("error updating volume '%s': %s", old.Name, err.Error())

}
}
return nil
Expand Down

0 comments on commit 93062cd

Please sign in to comment.