Skip to content
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(ebs): fix missing param in sc when modify ebs #4892

Merged
merged 1 commit into from Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/manager/volumes/delegation/aws/ebs_modifier.go
Expand Up @@ -131,6 +131,7 @@ func (m *EBSModifier) ModifyVolume(ctx context.Context, pvc *corev1.PersistentVo
return true, nil
}

// If some params are not set, assume they are equal.
func (m *EBSModifier) diffVolume(actual, desired *Volume) bool {
if diffInt32(actual.IOPS, desired.IOPS) {
return true
Expand All @@ -141,6 +142,9 @@ func (m *EBSModifier) diffVolume(actual, desired *Volume) bool {
if diffInt32(actual.Size, desired.Size) {
return true
}
if actual.Type == "" || desired.Type == "" {
return false
}
if actual.Type != desired.Type {
return true
}
Expand All @@ -149,12 +153,8 @@ func (m *EBSModifier) diffVolume(actual, desired *Volume) bool {
}

func diffInt32(a, b *int32) bool {
if a == nil && b == nil {
return false
}

if a == nil || b == nil {
return true
return false
}

if *a == *b {
Expand Down