MCPcopy
hub / github.com/helm/helm / Create

Method Create

pkg/storage/storage.go:64–78  ·  view source on GitHub ↗

Create creates a new storage entry holding the release. An error is returned if the storage driver fails to store the release, or a release with an identical key already exists.

(rls release.Releaser)

Source from the content-addressed store, hash-verified

62// error is returned if the storage driver fails to store the
63// release, or a release with an identical key already exists.
64func (s *Storage) Create(rls release.Releaser) error {
65 rac, err := release.NewAccessor(rls)
66 if err != nil {
67 return err
68 }
69 s.Logger().Debug("creating release", "key", makeKey(rac.Name(), rac.Version()))
70 if s.MaxHistory > 0 {
71 // Want to make space for one more release.
72 if err := s.removeLeastRecent(rac.Name(), s.MaxHistory-1); err != nil &&
73 !errors.Is(err, driver.ErrReleaseNotFound) {
74 return err
75 }
76 }
77 return s.Driver.Create(makeKey(rac.Name(), rac.Version()), rls)
78}
79
80// Update updates the release in storage. An error is returned if the
81// storage backend fails to update the release or if the release

Callers

nothing calls this directly

Calls 7

NameMethod · 0.95
VersionMethod · 0.95
removeLeastRecentMethod · 0.95
makeKeyFunction · 0.85
IsMethod · 0.80
LoggerMethod · 0.65
CreateMethod · 0.65

Tested by

no test coverage detected