Skip to content

Commit

Permalink
Don't delete CRDs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschuch committed Sep 3, 2020
1 parent 7bc4d61 commit a7b1081
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions internal/kubernetes/apiextensions/v1beta1/crd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@ package crd

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/previousnext/terraform-provider-k8s/internal/terraform/config"
"github.com/previousnext/terraform-provider-k8s/internal/terraform/id"
)

// Delete the StorageClass.
func Delete(d *schema.ResourceData, m interface{}) error {
conn := m.(*config.Client)

_, name, err := id.Split(d.Id())
if err != nil {
return errors.Wrap(err, "failed to delete")
}

return conn.APIExtensions().ApiextensionsV1beta1().CustomResourceDefinitions().Delete(name, &metav1.DeleteOptions{})
// We don't delete here. This generally results in very destructive outcomes.
return nil
}

0 comments on commit a7b1081

Please sign in to comment.