in commands/cleanup/cleanup.go [45:67]
func DoCleanupAccordingE2E() error {
e2eConfig := config.GlobalConfig.E2EConfig
if e2eConfig.Setup.Env == constant.Kind {
kubeConfigPath := e2eConfig.Setup.GetKubeconfig()
// if there is an existing kubernetes cluster, don't delete the kind cluster.
if kubeConfigPath == "" {
err := cleanup.KindCleanUp(&e2eConfig)
if err != nil {
return err
}
}
} else if e2eConfig.Setup.Env == constant.Compose {
err := cleanup.ComposeCleanUp(&e2eConfig)
if err != nil {
return err
}
} else {
return fmt.Errorf("no such env for cleanup: [%s]. should use kind or compose instead", e2eConfig.Setup.Env)
}
return nil
}