-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix forbidden error when updating volumes stack #1538
Conversation
Signed-off-by: Javier López Barba <javier@okteto.com>
pkg/cmd/stack/deploy.go
Outdated
@@ -229,8 +229,11 @@ func deployVolume(ctx context.Context, volumeName string, s *model.Stack, c *kub | |||
if old.Labels[okLabels.StackNameLabel] != s.Name { | |||
return fmt.Errorf("name collision: the volume '%s' belongs to the stack '%s'", pvc.Name, old.Labels[okLabels.StackNameLabel]) | |||
} | |||
if err := volumes.Update(ctx, &pvc, c); err != nil { | |||
return fmt.Errorf("error updating volume of service '%s': %s", pvc.Name, err.Error()) | |||
if !volumes.IsEqual(&pvc, old) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this in every case? if they are equal, it should do nothing.
Also, can you try that it is possible to change the volume size and the change takes effect in the volume?
Codecov Report
@@ Coverage Diff @@
## master #1538 +/- ##
==========================================
- Coverage 35.99% 35.97% -0.02%
==========================================
Files 88 88
Lines 8405 8414 +9
==========================================
+ Hits 3025 3027 +2
- Misses 5013 5019 +6
- Partials 367 368 +1
Continue to review full report at Codecov.
|
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
|
||
old.Spec.Resources.Requests["storage"] = pvc.Spec.Resources.Requests["storage"] | ||
for key, value := range pvc.Labels { | ||
old.Labels[key] = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove the old
labels?
Signed-off-by: Javier López Barba javier@okteto.com
Fixes: When there is a volume deployed and you want to update resources (Okteto stack deploy without running Okteto stack destroy), it gives you a forbidden error, because the volume name and storage class name are not set initially. These fields are given by Okteto cluster.
Proposed changes