@@ -44,14 +44,13 @@ var (
4444 "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
4545 "kubernetes_version" : Representation {repType : Required , create : `${oci_containerengine_cluster.test_cluster.kubernetes_version}` },
4646 "name" : Representation {repType : Required , create : `name` , update : `name2` },
47+ "node_image_name" : Representation {repType : Required , create : `${data.oci_containerengine_node_pool_option.test_node_pool_option.images.0}` },
4748 "node_shape" : Representation {repType : Required , create : `VM.Standard2.1` , update : `VM.Standard2.2` },
49+ "subnet_ids" : Representation {repType : Required , create : []string {`${oci_core_subnet.nodePool_Subnet_1.id}` , `${oci_core_subnet.nodePool_Subnet_2.id}` }},
4850 "initial_node_labels" : RepresentationGroup {Optional , nodePoolInitialNodeLabelsRepresentation },
49- "node_image_name" : Representation {repType : Optional , create : `${data.oci_containerengine_node_pool_option.test_node_pool_option.images.0}` },
5051 "node_metadata" : Representation {repType : Optional , create : map [string ]string {"nodeMetadata" : "nodeMetadata" }, update : map [string ]string {"nodeMetadata2" : "nodeMetadata2" }},
5152 "quantity_per_subnet" : Representation {repType : Optional , create : `1` , update : `2` },
52- "ssh_public_key" : Representation {repType : Optional , create : `ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample` },
53- "subnet_ids" : Representation {repType : Optional , create : []string {`${oci_core_subnet.nodePool_Subnet_1.id}` , `${oci_core_subnet.nodePool_Subnet_2.id}` }},
54- }
53+ "ssh_public_key" : Representation {repType : Optional , create : `ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample` }}
5554 nodePoolInitialNodeLabelsRepresentation = map [string ]interface {}{
5655 "key" : Representation {repType : Optional , create : `key` , update : `key2` },
5756 "value" : Representation {repType : Optional , create : `value` , update : `value2` },
6564 generateResourceFromRepresentationMap ("oci_core_subnet" , "clusterSubnet_2" , Required , Create , representationCopyWithNewProperties (subnetRepresentation , map [string ]interface {}{"availability_domain" : Representation {repType : Required , create : `${lower("${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}")}` }, "cidr_block" : Representation {repType : Required , create : `10.0.21.0/24` }, "dns_label" : Representation {repType : Required , create : `cluster2` }})) +
6665 AvailabilityDomainConfig +
6766 generateDataSourceFromRepresentationMap ("oci_containerengine_cluster_option" , "test_cluster_option" , Required , Create , clusterOptionSingularDataSourceRepresentation ) +
68- OciImageIdsVariable +
6967 generateResourceFromRepresentationMap ("oci_core_vcn" , "test_vcn" , Required , Create , representationCopyWithNewProperties (vcnRepresentation , map [string ]interface {}{
7068 "dns_label" : Representation {repType : Required , create : `dnslabel` },
7169 }))
@@ -107,6 +105,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
107105 resource .TestCheckResourceAttrSet (resourceName , "kubernetes_version" ),
108106 resource .TestCheckResourceAttr (resourceName , "name" , "name" ),
109107 resource .TestCheckResourceAttr (resourceName , "node_shape" , "VM.Standard2.1" ),
108+ resource .TestCheckResourceAttr (resourceName , "subnet_ids.#" , "2" ),
110109
111110 func (s * terraform.State ) (err error ) {
112111 resId , err = fromInstanceState (s , resourceName , "id" )
@@ -137,6 +136,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
137136 resource .TestCheckResourceAttr (resourceName , "node_shape" , "VM.Standard2.1" ),
138137 resource .TestCheckResourceAttr (resourceName , "quantity_per_subnet" , "1" ),
139138 resource .TestCheckResourceAttr (resourceName , "ssh_public_key" , "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample" ),
139+ resource .TestCheckResourceAttr (resourceName , "subnet_ids.#" , "2" ),
140140
141141 func (s * terraform.State ) (err error ) {
142142 resId , err = fromInstanceState (s , resourceName , "id" )
@@ -153,7 +153,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
153153 // verify updates to updatable parameters
154154 {
155155 Config : config + compartmentIdVariableStr + NodePoolResourceDependencies +
156- generateResourceFromRepresentationMap ("oci_containerengine_node_pool" , "test_node_pool" , Optional , Update , nodePoolRepresentation ),
156+ generateResourceFromRepresentationMap ("oci_containerengine_node_pool" , "test_node_pool" , Optional , Update , getUpdatedRepresentationCopy ( "node_metadata" , Representation { repType : Optional , update : map [ string ] string { "nodeMetadata" : "nodeMetadata" }}, nodePoolRepresentation ) ),
157157 Check : resource .ComposeAggregateTestCheckFunc (
158158 resource .TestCheckResourceAttrSet (resourceName , "cluster_id" ),
159159 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
@@ -168,6 +168,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
168168 resource .TestCheckResourceAttr (resourceName , "node_shape" , "VM.Standard2.2" ),
169169 resource .TestCheckResourceAttr (resourceName , "quantity_per_subnet" , "2" ),
170170 resource .TestCheckResourceAttr (resourceName , "ssh_public_key" , "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample" ),
171+ resource .TestCheckResourceAttr (resourceName , "subnet_ids.#" , "2" ),
171172
172173 func (s * terraform.State ) (err error ) {
173174 resId2 , err = fromInstanceState (s , resourceName , "id" )
@@ -198,7 +199,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
198199 resource .TestCheckResourceAttr (datasourceName , "node_pools.0.initial_node_labels.0.value" , "value2" ),
199200 resource .TestCheckResourceAttrSet (datasourceName , "node_pools.0.kubernetes_version" ),
200201 resource .TestCheckResourceAttr (datasourceName , "node_pools.0.name" , "name2" ),
201- resource .TestCheckResourceAttr (datasourceName , "node_pools.0.node_image_id" , "nodeImageId " ),
202+ resource .TestCheckResourceAttrSet (datasourceName , "node_pools.0.node_image_id" ),
202203 resource .TestCheckResourceAttrSet (datasourceName , "node_pools.0.node_image_name" ),
203204 resource .TestCheckResourceAttr (datasourceName , "node_pools.0.node_shape" , "VM.Standard2.2" ),
204205 resource .TestCheckResourceAttr (datasourceName , "node_pools.0.node_source.#" , "1" ),
@@ -212,6 +213,7 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
212213 generateDataSourceFromRepresentationMap ("oci_containerengine_node_pool" , "test_node_pool" , Required , Create , nodePoolSingularDataSourceRepresentation ) +
213214 compartmentIdVariableStr + NodePoolResourceConfig ,
214215 Check : resource .ComposeAggregateTestCheckFunc (
216+ resource .TestCheckResourceAttrSet (singularDatasourceName , "cluster_id" ),
215217 resource .TestCheckResourceAttrSet (singularDatasourceName , "node_pool_id" ),
216218
217219 resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
@@ -222,12 +224,13 @@ func TestContainerengineNodePoolResource_basic(t *testing.T) {
222224 resource .TestCheckResourceAttrSet (singularDatasourceName , "kubernetes_version" ),
223225 resource .TestCheckResourceAttr (singularDatasourceName , "name" , "name2" ),
224226 resource .TestCheckResourceAttrSet (singularDatasourceName , "node_image_id" ),
227+ resource .TestCheckResourceAttrSet (singularDatasourceName , "node_image_name" ),
225228 resource .TestCheckResourceAttr (singularDatasourceName , "node_metadata.%" , "1" ),
226229 resource .TestCheckResourceAttr (singularDatasourceName , "node_shape" , "VM.Standard2.2" ),
227230 resource .TestCheckResourceAttr (singularDatasourceName , "node_source.#" , "1" ),
228- resource .TestCheckResourceAttr (singularDatasourceName , "nodes.#" , "1" ),
229231 resource .TestCheckResourceAttr (singularDatasourceName , "quantity_per_subnet" , "2" ),
230232 resource .TestCheckResourceAttr (singularDatasourceName , "ssh_public_key" , "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample" ),
233+ resource .TestCheckResourceAttr (singularDatasourceName , "subnet_ids.#" , "2" ),
231234 ),
232235 },
233236 // remove singular datasource from previous step so that it doesn't conflict with import tests
0 commit comments