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 flexvolume volumename issue #80904

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pkg/volume/flexvolume/plugin-defaults.go
Expand Up @@ -29,6 +29,6 @@ func logPrefix(plugin *flexVolumePlugin) string {
}

func (plugin *pluginDefaults) GetVolumeName(spec *volume.Spec) (string, error) {
klog.Warning(logPrefix((*flexVolumePlugin)(plugin)), "using default GetVolumeName for volume ", spec.Name())
klog.V(4).Infof(logPrefix((*flexVolumePlugin)(plugin)), "using default GetVolumeName for volume ", spec.Name())
return spec.Name(), nil
}
2 changes: 1 addition & 1 deletion pkg/volume/flexvolume/plugin.go
Expand Up @@ -134,7 +134,7 @@ func (plugin *flexVolumePlugin) GetVolumeName(spec *volume.Spec) (string, error)
return "", err
}

klog.Warning(logPrefix(plugin), "GetVolumeName is not supported yet. Defaulting to PV or volume name: ", name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reduce verbosity of this message instead of removing it altogether?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reduce verbosity of this message instead of removing it altogether?

There is default volumeName log in GetVolumeName:

klog.V(4).Infof(logPrefix((*flexVolumePlugin)(plugin)), "using default GetVolumeName for volume ", spec.Name())

And, the message "GetVolumeName is not supported yet. Defaulting to PV or volume name: " is not suitable here, this log will be printed out when GetVolumeName is supported by plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fredkan GetVolumeName is not supported on the K8S side, not on the plugin side. I would recommend to just adjust the verbosity of the logs, unless there is a big need to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Thanks.

klog.V(4).Infof(logPrefix(plugin), "GetVolumeName is not supported yet. Defaulting to PV or volume name: ", name)

return name, nil
}
Expand Down