From 9e966534a072b1dd0eb22c59813012ccedc89da6 Mon Sep 17 00:00:00 2001 From: Edward Rousseau Date: Fri, 14 May 2021 07:03:54 +1000 Subject: [PATCH] Add diff suppression for hard limits on kubernetes_resource_quota (#1251) Co-authored-by: John Houston --- kubernetes/resource_kubernetes_resource_quota.go | 11 ++++++----- kubernetes/resource_kubernetes_resource_quota_test.go | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/kubernetes/resource_kubernetes_resource_quota.go b/kubernetes/resource_kubernetes_resource_quota.go index bcb3b62b48..be358592c6 100644 --- a/kubernetes/resource_kubernetes_resource_quota.go +++ b/kubernetes/resource_kubernetes_resource_quota.go @@ -42,11 +42,12 @@ func resourceKubernetesResourceQuota() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "hard": { - Type: schema.TypeMap, - Description: "The set of desired hard limits for each named resource. More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota", - Optional: true, - Elem: schema.TypeString, - ValidateFunc: validateResourceList, + Type: schema.TypeMap, + Description: "The set of desired hard limits for each named resource. More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota", + Optional: true, + Elem: schema.TypeString, + ValidateFunc: validateResourceList, + DiffSuppressFunc: suppressEquivalentResourceQuantity, }, "scopes": { Type: schema.TypeSet, diff --git a/kubernetes/resource_kubernetes_resource_quota_test.go b/kubernetes/resource_kubernetes_resource_quota_test.go index c693d98659..82a040f167 100644 --- a/kubernetes/resource_kubernetes_resource_quota_test.go +++ b/kubernetes/resource_kubernetes_resource_quota_test.go @@ -332,7 +332,7 @@ func testAccKubernetesResourceQuotaConfig_basic(name string) string { spec { hard = { "limits.cpu" = 2 - "limits.memory" = "2Gi" + "limits.memory" = "2048Mi" pods = 4 } }