Skip to content

Commit 3d0d973

Browse files
committed
Fix import and some tests
1 parent 743d34a commit 3d0d973

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

manifest/provider/import.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,15 @@ func (s *RawProviderServer) ImportResourceState(ctx context.Context, req *tfprot
140140

141141
newState := make(map[string]tftypes.Value)
142142
wftype := rt.(tftypes.Object).AttributeTypes["wait_for"]
143+
timeoutsType := rt.(tftypes.Object).AttributeTypes["timeouts"]
144+
fmType := rt.(tftypes.Object).AttributeTypes["field_manager"]
145+
143146
newState["manifest"] = tftypes.NewValue(tftypes.Object{AttributeTypes: map[string]tftypes.Type{}}, nil)
144147
newState["object"] = morph.UnknownToNull(nobj)
145148
newState["wait_for"] = tftypes.NewValue(wftype, nil)
149+
newState["timeouts"] = tftypes.NewValue(timeoutsType, nil)
150+
newState["field_manager"] = tftypes.NewValue(fmType, nil)
151+
146152
nsVal := tftypes.NewValue(rt, newState)
147153

148154
impState, err := tfprotov5.NewDynamicValue(nsVal.Type(), nsVal)

manifest/test/acceptance/fieldmanager_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build acceptance
12
// +build acceptance
23

34
package acceptance
@@ -6,6 +7,7 @@ import (
67
"strings"
78
"testing"
89

10+
"github.com/hashicorp/terraform-provider-kubernetes/manifest/test/helper/kubernetes"
911
tfstatehelper "github.com/hashicorp/terraform-provider-kubernetes/manifest/test/helper/state"
1012
)
1113

@@ -22,7 +24,7 @@ func TestKubernetesManifest_fieldManager(t *testing.T) {
2224
}()
2325

2426
k8shelper.CreateNamespace(t, namespace)
25-
defer k8shelper.DeleteNamespace(t, namespace)
27+
defer k8shelper.DeleteResource(t, namespace, kubernetes.NewGroupVersionResource("v1", "namespaces"))
2628

2729
// 1. Create the resource
2830
tfvars := TFVARS{

0 commit comments

Comments
 (0)