Skip to content

Commit 352c8b4

Browse files
committed
Maintain previous naming of error field to avoid breaking change
Also remove `status` field; since it's not plumbed through.
1 parent eb6718e commit 352c8b4

File tree

5 files changed

+39
-50
lines changed

5 files changed

+39
-50
lines changed

oci/containerengine_node_pool_data_source.go

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,7 @@ func NodePoolDataSource() *schema.Resource {
8383
Type: schema.TypeString,
8484
Computed: true,
8585
},
86-
"id": {
87-
Type: schema.TypeString,
88-
Computed: true,
89-
},
90-
"lifecycle_details": {
91-
Type: schema.TypeString,
92-
Computed: true,
93-
},
94-
"name": {
95-
Type: schema.TypeString,
96-
Computed: true,
97-
},
98-
"node_error": {
86+
"error": {
9987
Type: schema.TypeList,
10088
Computed: true,
10189
MaxItems: 1,
@@ -115,13 +103,21 @@ func NodePoolDataSource() *schema.Resource {
115103
Type: schema.TypeString,
116104
Computed: true,
117105
},
118-
"status": {
119-
Type: schema.TypeString,
120-
Computed: true,
121-
},
122106
},
123107
},
124108
},
109+
"id": {
110+
Type: schema.TypeString,
111+
Computed: true,
112+
},
113+
"lifecycle_details": {
114+
Type: schema.TypeString,
115+
Computed: true,
116+
},
117+
"name": {
118+
Type: schema.TypeString,
119+
Computed: true,
120+
},
125121
"node_pool_id": {
126122
Type: schema.TypeString,
127123
Computed: true,

oci/containerengine_node_pool_resource.go

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,7 @@ func NodePoolResource() *schema.Resource {
120120
Type: schema.TypeString,
121121
Computed: true,
122122
},
123-
"id": {
124-
Type: schema.TypeString,
125-
Computed: true,
126-
},
127-
"lifecycle_details": {
128-
Type: schema.TypeString,
129-
Computed: true,
130-
},
131-
"name": {
132-
Type: schema.TypeString,
133-
Computed: true,
134-
},
135-
"node_error": {
123+
"error": {
136124
Type: schema.TypeList,
137125
Computed: true,
138126
MaxItems: 1,
@@ -152,13 +140,21 @@ func NodePoolResource() *schema.Resource {
152140
Type: schema.TypeString,
153141
Computed: true,
154142
},
155-
"status": {
156-
Type: schema.TypeString,
157-
Computed: true,
158-
},
159143
},
160144
},
161145
},
146+
"id": {
147+
Type: schema.TypeString,
148+
Computed: true,
149+
},
150+
"lifecycle_details": {
151+
Type: schema.TypeString,
152+
Computed: true,
153+
},
154+
"name": {
155+
Type: schema.TypeString,
156+
Computed: true,
157+
},
162158
"node_pool_id": {
163159
Type: schema.TypeString,
164160
Computed: true,
@@ -558,6 +554,10 @@ func NodeToMap(obj oci_containerengine.Node) map[string]interface{} {
558554
result["availability_domain"] = string(*obj.AvailabilityDomain)
559555
}
560556

557+
if obj.NodeError != nil {
558+
result["error"] = []interface{}{NodeErrorToMap(obj.NodeError)}
559+
}
560+
561561
if obj.Id != nil {
562562
result["id"] = string(*obj.Id)
563563
}
@@ -570,10 +570,6 @@ func NodeToMap(obj oci_containerengine.Node) map[string]interface{} {
570570
result["name"] = string(*obj.Name)
571571
}
572572

573-
if obj.NodeError != nil {
574-
result["node_error"] = []interface{}{NodeErrorToMap(obj.NodeError)}
575-
}
576-
577573
if obj.NodePoolId != nil {
578574
result["node_pool_id"] = string(*obj.NodePoolId)
579575
}

website/docs/d/containerengine_node_pool.html.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ The following attributes are exported:
4444
* `node_shape` - The name of the node shape of the nodes in the node pool.
4545
* `nodes` - The nodes in the node pool.
4646
* `availability_domain` - The name of the availability domain in which this node is placed.
47+
* `error` - An error that may be associated with the node.
48+
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
49+
* `message` - A human-readable error string of the upstream error.
4750
* `id` - The OCID of the compute instance backing this node.
4851
* `lifecycle_details` - Details about the state of the node.
4952
* `name` - The name of the node.
50-
* `node_error` - An error that may be associated with the node.
51-
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
52-
* `message` - A human-readable error string of the upstream error.
53-
* `status` - The status of the HTTP response encountered in the upstream error.
5453
* `node_pool_id` - The OCID of the node pool to which this node belongs.
5554
* `public_ip` - The public IP address of this node.
5655
* `state` - The state of the node.

website/docs/d/containerengine_node_pools.html.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ The following attributes are exported:
5656
* `node_shape` - The name of the node shape of the nodes in the node pool.
5757
* `nodes` - The nodes in the node pool.
5858
* `availability_domain` - The name of the availability domain in which this node is placed.
59+
* `error` - An error that may be associated with the node.
60+
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
61+
* `message` - A human-readable error string of the upstream error.
5962
* `id` - The OCID of the compute instance backing this node.
6063
* `lifecycle_details` - Details about the state of the node.
6164
* `name` - The name of the node.
62-
* `node_error` - An error that may be associated with the node.
63-
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
64-
* `message` - A human-readable error string of the upstream error.
65-
* `status` - The status of the HTTP response encountered in the upstream error.
6665
* `node_pool_id` - The OCID of the node pool to which this node belongs.
6766
* `public_ip` - The public IP address of this node.
6867
* `state` - The state of the node.

website/docs/r/containerengine_node_pool.html.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ The following attributes are exported:
7474
* `node_shape` - The name of the node shape of the nodes in the node pool.
7575
* `nodes` - The nodes in the node pool.
7676
* `availability_domain` - The name of the availability domain in which this node is placed.
77+
* `error` - An error that may be associated with the node.
78+
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
79+
* `message` - A human-readable error string of the upstream error.
7780
* `id` - The OCID of the compute instance backing this node.
7881
* `lifecycle_details` - Details about the state of the node.
7982
* `name` - The name of the node.
80-
* `node_error` - An error that may be associated with the node.
81-
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
82-
* `message` - A human-readable error string of the upstream error.
83-
* `status` - The status of the HTTP response encountered in the upstream error.
8483
* `node_pool_id` - The OCID of the node pool to which this node belongs.
8584
* `public_ip` - The public IP address of this node.
8685
* `state` - The state of the node.

0 commit comments

Comments
 (0)