Remove test --cleanup flag

Signed-off-by: Jacob LeGrone <git@jacob.work>
pull/6363/head
Jacob LeGrone 5 years ago
parent a6f4bc1bc0
commit 6f18519957
No known key found for this signature in database
GPG Key ID: 5FD0852F235368C1

@ -17,9 +17,6 @@ limitations under the License.
package action
import (
"bytes"
"fmt"
"strings"
"time"
"github.com/pkg/errors"
@ -31,10 +28,8 @@ import (
//
// It provides the implementation of 'helm test'.
type ReleaseTesting struct {
cfg *Configuration
cfg *Configuration
Timeout time.Duration
Cleanup bool
}
// NewReleaseTesting creates a new ReleaseTesting object with the given configuration.
@ -65,23 +60,5 @@ func (r *ReleaseTesting) Run(name string) error {
return err
}
if r.Cleanup {
var manifestsToDelete strings.Builder
for _, h := range rel.Hooks {
for _, e := range h.Events {
if e == release.HookTest {
fmt.Fprintf(&manifestsToDelete, "\n---\n%s", h.Manifest)
}
}
}
hooks, err := r.cfg.KubeClient.Build(bytes.NewBufferString(manifestsToDelete.String()), false)
if err != nil {
return fmt.Errorf("unable to build test hooks: %v", err)
}
if _, errs := r.cfg.KubeClient.Delete(hooks); errs != nil {
return fmt.Errorf("unable to delete test hooks: %v", joinErrors(errs))
}
}
return r.cfg.Releases.Update(rel)
}

Loading…
Cancel
Save