mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-15 20:37:39 +00:00
Merge pull request #113325 from panslava/fix-time-since-defer
Fix time.Since() in defer. Wrap in anonymous function
This commit is contained in:
@@ -435,7 +435,9 @@ func (e *execPlugin) ExecPlugin(ctx context.Context, image string) (*credentialp
|
||||
|
||||
func (e *execPlugin) runPlugin(ctx context.Context, cmd *exec.Cmd, image string) error {
|
||||
startTime := time.Now()
|
||||
defer kubeletCredentialProviderPluginDuration.WithLabelValues(e.name).Observe(time.Since(startTime).Seconds())
|
||||
defer func() {
|
||||
kubeletCredentialProviderPluginDuration.WithLabelValues(e.name).Observe(time.Since(startTime).Seconds())
|
||||
}()
|
||||
|
||||
err := cmd.Run()
|
||||
if ctx.Err() != nil {
|
||||
|
||||
Reference in New Issue
Block a user