-
Notifications
You must be signed in to change notification settings - Fork 1k
do not call EBS api when there are no pvs #1851
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
Conversation
return nil | ||
} | ||
c.logger.Infof("starting EBS gp2 to gp3 migration") | ||
|
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.
c.OpConfig.EnableEBSGp3Migration
is already checked before calling executeEBSMigration
. The log line is quite confusing because the function is executed every sync and at this point it's not decided yet, that a migration is actually happening.
@@ -149,7 +148,11 @@ func (c *Cluster) populateVolumeMetaData() error { | |||
if err != nil { | |||
return fmt.Errorf("could not list persistent volumes: %v", err) | |||
} | |||
c.logger.Debugf("found %d volumes, size of known volumes %d", len(pvs), len(c.EBSVolumes)) | |||
if len(pvs) == 0 { | |||
c.EBSVolumes = make(map[string]volumes.VolumeProperties) |
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.
reset c.EBSVolumes when there are no persistent volume claims
@@ -167,7 +170,7 @@ func (c *Cluster) populateVolumeMetaData() error { | |||
return err | |||
} | |||
|
|||
if len(currentVolumes) != len(c.EBSVolumes) { | |||
if len(currentVolumes) != len(c.EBSVolumes) && len(c.EBSVolumes) > 0 { |
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.
On first run c.EBSVolumes will be empty at this point. We already logged the size of known volumes above. Therefore, we should print this debug message only on subsequent sync runs and only if there is a difference.
👍 |
1 similar comment
👍 |
Only minor adjustments to improve syncing volumes when resize mode is
ebs
.