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 all 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
4 changes: 4 additions & 0 deletions pkg/controller/perconaservermongodb/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func validatePVCName(pvc corev1.PersistentVolumeClaim, sts *appsv1.StatefulSet)
}

func (r *ReconcilePerconaServerMongoDB) resizeVolumesIfNeeded(ctx context.Context, cr *psmdbv1.PerconaServerMongoDB, sts *appsv1.StatefulSet, ls map[string]string, volumeSpec *api.VolumeSpec) error {
if cr.Spec.ExternalVolumeAutoscaling {
return nil
}

log := logf.FromContext(ctx).WithName("PVCResize").WithValues("sts", sts.Name)

pvcSpec := volumeSpec.PersistentVolumeClaim
Expand Down