MCPcopy
hub / github.com/helm/helm / updatePlugin

Function updatePlugin

pkg/cmd/plugin_update.go:88–113  ·  view source on GitHub ↗
(p plugin.Plugin)

Source from the content-addressed store, hash-verified

86}
87
88func updatePlugin(p plugin.Plugin) error {
89 exactLocation, err := filepath.EvalSymlinks(p.Dir())
90 if err != nil {
91 return err
92 }
93 absExactLocation, err := filepath.Abs(exactLocation)
94 if err != nil {
95 return err
96 }
97
98 i, err := installer.FindSource(absExactLocation)
99 if err != nil {
100 return err
101 }
102 if err := installer.Update(i); err != nil {
103 return err
104 }
105
106 slog.Debug("loading plugin", "path", i.Path())
107 updatedPlugin, err := plugin.LoadDir(i.Path())
108 if err != nil {
109 return err
110 }
111
112 return runHook(updatedPlugin, plugin.Update)
113}

Callers 1

runMethod · 0.85

Calls 6

FindSourceFunction · 0.92
UpdateFunction · 0.92
LoadDirFunction · 0.92
runHookFunction · 0.85
DirMethod · 0.65
PathMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…