Skip to content

Suppress storage discrepancy error if external volume autoscaling is enabled #1897

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ spec:
type: string
enableVolumeExpansion:
type: boolean
externalVolumeAutoscaling:
type: boolean
ignoreAnnotations:
items:
type: string
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/psmdb/v1/psmdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type PerconaServerMongoDBSpec struct {
Users []User `json:"users,omitempty"`
Roles []Role `json:"roles,omitempty"`
VolumeExpansionEnabled bool `json:"enableVolumeExpansion,omitempty"`
ExternalVolumeAutoscaling bool `json:"externalVolumeAutoscaling,omitempty"`
}

type UserRole struct {
Expand Down
6 changes: 5 additions & 1 deletion pkg/controller/perconaservermongodb/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ func (r *ReconcilePerconaServerMongoDB) resizeVolumesIfNeeded(ctx context.Contex
}

if requested.Cmp(actual) < 0 {
return errors.Errorf("requested storage (%s) is less than actual storage (%s)", requested.String(), actual.String())
if !cr.Spec.ExternalVolumeAutoscaling {
return errors.Errorf("requested storage (%s) is less than actual storage (%s)", requested.String(), actual.String())
} else {
return nil
}
}

if requested.Cmp(actual) == 0 {
Expand Down