@ -283,6 +283,12 @@ func (s *ReleaseServer) GetReleaseContent(c ctx.Context, req *services.GetReleas
// UpdateRelease takes an existing release and new information, and upgrades the release.
// UpdateRelease takes an existing release and new information, and upgrades the release.
func ( s * ReleaseServer ) UpdateRelease ( c ctx . Context , req * services . UpdateReleaseRequest ) ( * services . UpdateReleaseResponse , error ) {
func ( s * ReleaseServer ) UpdateRelease ( c ctx . Context , req * services . UpdateReleaseRequest ) ( * services . UpdateReleaseResponse , error ) {
err := s . env . Releases . LockRelease ( req . Name )
if err != nil {
return nil , err
}
defer s . env . Releases . UnlockRelease ( req . Name )
currentRelease , updatedRelease , err := s . prepareUpdate ( req )
currentRelease , updatedRelease , err := s . prepareUpdate ( req )
if err != nil {
if err != nil {
return nil , err
return nil , err
@ -465,6 +471,12 @@ func (s *ReleaseServer) prepareUpdate(req *services.UpdateReleaseRequest) (*rele
// RollbackRelease rolls back to a previous version of the given release.
// RollbackRelease rolls back to a previous version of the given release.
func ( s * ReleaseServer ) RollbackRelease ( c ctx . Context , req * services . RollbackReleaseRequest ) ( * services . RollbackReleaseResponse , error ) {
func ( s * ReleaseServer ) RollbackRelease ( c ctx . Context , req * services . RollbackReleaseRequest ) ( * services . RollbackReleaseResponse , error ) {
err := s . env . Releases . LockRelease ( req . Name )
if err != nil {
return nil , err
}
defer s . env . Releases . UnlockRelease ( req . Name )
currentRelease , targetRelease , err := s . prepareRollback ( req )
currentRelease , targetRelease , err := s . prepareRollback ( req )
if err != nil {
if err != nil {
return nil , err
return nil , err
@ -983,6 +995,12 @@ func (s *ReleaseServer) purgeReleases(rels ...*release.Release) error {
// UninstallRelease deletes all of the resources associated with this release, and marks the release DELETED.
// UninstallRelease deletes all of the resources associated with this release, and marks the release DELETED.
func ( s * ReleaseServer ) UninstallRelease ( c ctx . Context , req * services . UninstallReleaseRequest ) ( * services . UninstallReleaseResponse , error ) {
func ( s * ReleaseServer ) UninstallRelease ( c ctx . Context , req * services . UninstallReleaseRequest ) ( * services . UninstallReleaseResponse , error ) {
err := s . env . Releases . LockRelease ( req . Name )
if err != nil {
return nil , err
}
defer s . env . Releases . UnlockRelease ( req . Name )
if ! ValidName . MatchString ( req . Name ) {
if ! ValidName . MatchString ( req . Name ) {
log . Printf ( "uninstall: Release not found: %s" , req . Name )
log . Printf ( "uninstall: Release not found: %s" , req . Name )
return nil , errMissingRelease
return nil , errMissingRelease