Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions pkg/ddc/thin/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ package thin
import (
"context"
"fmt"

"github.com/fluid-cloudnative/fluid/pkg/common"
"github.com/fluid-cloudnative/fluid/pkg/utils"
"github.com/fluid-cloudnative/fluid/pkg/utils/dataset/lifecycle"
"github.com/fluid-cloudnative/fluid/pkg/utils/helm"
"github.com/fluid-cloudnative/fluid/pkg/utils/kubeclient"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package "k8s.io/apimachinery/pkg/api/errors" is being imported more than once

"k8s.io/apimachinery/pkg/labels"
Expand Down Expand Up @@ -221,14 +223,21 @@ func (t *ThinEngine) cleanAll() (err error) {

var (
valueConfigmapName = t.getHelmValuesConfigMapName()
configmapName = t.name + "-config"
thinConfigmapName = t.name + "-config"
namespace = t.namespace
)

cms := []string{valueConfigmapName, configmapName}
cmNames := []string{valueConfigmapName, thinConfigmapName}

for _, cm := range cms {
err = kubeclient.DeleteConfigMap(t.Client, cm, namespace)
for _, cmName := range cmNames {
_, err = kubeclient.GetConfigmapByName(t.Client, cmName, namespace)
if err != nil {
if apierrors.IsNotFound(err) {
return nil
}
return err
}
err = kubeclient.DeleteConfigMap(t.Client, cmName, namespace)
if err != nil {
return
}
Expand Down
Loading