MCPcopy
hub / github.com/helm/helm / createTarballFromPluginDir

Function createTarballFromPluginDir

internal/plugin/installer/verification_test.go:356–373  ·  view source on GitHub ↗
(t *testing.T, pluginDir string)

Source from the content-addressed store, hash-verified

354}
355
356func createTarballFromPluginDir(t *testing.T, pluginDir string) string {
357 t.Helper()
358
359 // Create tarball using the plugin package helper
360 tmpDir := filepath.Dir(pluginDir)
361 tgzPath := filepath.Join(tmpDir, "test-plugin-1.0.0.tgz")
362 tarFile, err := os.Create(tgzPath)
363 if err != nil {
364 t.Fatalf("Failed to create tarball file: %v", err)
365 }
366 defer tarFile.Close()
367
368 if err := plugin.CreatePluginTarball(pluginDir, "test-plugin", tarFile); err != nil {
369 t.Fatalf("Failed to create tarball: %v", err)
370 }
371
372 return tgzPath
373}
374
375func createProvFile(t *testing.T, provFile, pluginTgz, hash string) {
376 t.Helper()

Calls 6

CreatePluginTarballFunction · 0.92
HelperMethod · 0.80
FatalfMethod · 0.80
CloseMethod · 0.80
DirMethod · 0.65
CreateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…