@@ -4,33 +4,33 @@ import (
4
4
"context"
5
5
"encoding/base64"
6
6
7
+ v20220501 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke/v20220501"
8
+
7
9
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
8
10
)
9
11
10
12
func resourceTencentCloudKubernetesNativeNodePoolReadPostHandleResponse0 (ctx context.Context , resp * v20220501.NodePool ) error {
11
13
d := tccommon .ResourceDataFromContext (ctx )
12
- meta := tccommon .ProviderMetaFromContext (ctx )
13
-
14
- service := TkeService {client : meta .(tccommon.ProviderMeta ).GetAPIV3Conn ()}
15
14
respData := resp
16
15
17
- lifecycleMap := map [string ]interface {}{}
18
- nativeMap = d .Get ("native" ).([]interface {}).(map [string ]interface {})
16
+ if respData .Native != nil {
17
+ nativeMap := d .Get ("native" ).([]interface {})
18
+ lifecycleMap := map [string ]interface {}{}
19
+ if respData .Native .Lifecycle != nil {
20
+ if respData .Native .Lifecycle .PreInit != nil {
21
+ lifecycleMap ["pre_init" ] = base64 .StdEncoding .EncodeToString ([]byte (* respData .Native .Lifecycle .PreInit ))
22
+ //lifecycleMap["pre_init"] = respData.Native.Lifecycle.PreInit
23
+ }
19
24
20
- if respData .Native .Lifecycle != nil {
21
- if respData .Native .Lifecycle .PreInit != nil {
22
- lifecycleMap ["pre_init" ] = base64 .StdEncoding .EncodeToString ([]byte (* respData .Native .Lifecycle .PreInit ))
23
- //lifecycleMap["pre_init"] = respData.Native.Lifecycle.PreInit
24
- }
25
+ if respData .Native .Lifecycle .PostInit != nil {
26
+ lifecycleMap ["post_init" ] = base64 .StdEncoding .EncodeToString ([]byte (* respData .Native .Lifecycle .PostInit ))
27
+ //lifecycleMap["post_init"] = respData.Native.Lifecycle.PostInit
28
+ }
25
29
26
- if respData .Native .Lifecycle .PostInit != nil {
27
- lifecycleMap ["post_init" ] = base64 .StdEncoding .EncodeToString ([]byte (* respData .Native .Lifecycle .PostInit ))
28
- //lifecycleMap["post_init"] = respData.Native.Lifecycle.PostInit
30
+ nativeMap [0 ].(map [string ]interface {})["lifecycle" ] = []interface {}{lifecycleMap }
31
+ _ = d .Set ("native" , []interface {}{nativeMap })
29
32
}
30
-
31
- nativeMap ["lifecycle" ] = []interface {}{lifecycleMap }
32
33
}
33
- _ = d .Set ("native" , []interface {}{nativeMap })
34
34
35
35
annotationsList := make ([]map [string ]interface {}, 0 , len (respData .Annotations ))
36
36
if respData .Annotations != nil {
@@ -54,4 +54,6 @@ func resourceTencentCloudKubernetesNativeNodePoolReadPostHandleResponse0(ctx con
54
54
55
55
_ = d .Set ("annotations" , annotationsList )
56
56
}
57
+
58
+ return nil
57
59
}
0 commit comments