From a7b1081dad07837c52b356914d7d537d1c0d03c0 Mon Sep 17 00:00:00 2001 From: Nick Schuch Date: Thu, 3 Sep 2020 15:33:10 +1000 Subject: [PATCH] Don't delete CRDs --- .../apiextensions/v1beta1/crd/delete.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/internal/kubernetes/apiextensions/v1beta1/crd/delete.go b/internal/kubernetes/apiextensions/v1beta1/crd/delete.go index 523bb171..8c98ca47 100644 --- a/internal/kubernetes/apiextensions/v1beta1/crd/delete.go +++ b/internal/kubernetes/apiextensions/v1beta1/crd/delete.go @@ -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 }