@@ -240,6 +240,7 @@ func ContainerengineNodePoolResource() *schema.Resource {
240240 "FLANNEL_OVERLAY" ,
241241 "OCI_VCN_IP_NATIVE" ,
242242 }, true ),
243+ ForceNew : true ,
243244 },
244245
245246 // Optional
@@ -1770,7 +1771,6 @@ func NodePoolPlacementConfigDetailsToMap(obj oci_containerengine.NodePoolPlaceme
17701771 if obj .SubnetId != nil {
17711772 result ["subnet_id" ] = string (* obj .SubnetId )
17721773 }
1773-
17741774 return result
17751775}
17761776
@@ -2044,8 +2044,6 @@ func (s *ContainerengineNodePoolResourceCrud) hasNodeConfigDetailsChange(fieldKe
20442044
20452045func (s * ContainerengineNodePoolResourceCrud ) mapToUpdateNodePoolNodeConfigDetails (fieldKeyFormat string ) (oci_containerengine.UpdateNodePoolNodeConfigDetails , error ) {
20462046 result := oci_containerengine.UpdateNodePoolNodeConfigDetails {}
2047-
2048- result .PlacementConfigs = []oci_containerengine.NodePoolPlacementConfigDetails {}
20492047 if placementConfigs , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "placement_configs" )); ok {
20502048 set := placementConfigs .(* schema.Set )
20512049 interfaces := set .List ()
@@ -2059,34 +2057,45 @@ func (s *ContainerengineNodePoolResourceCrud) mapToUpdateNodePoolNodeConfigDetai
20592057 }
20602058 tmp [i ] = converted
20612059 }
2062- if len (tmp ) != 0 || s .D .HasChange (fmt .Sprintf (fieldKeyFormat , "placement_configs" )) {
2060+ if len (tmp ) != 0 && s .D .HasChange (fmt .Sprintf (fieldKeyFormat , "placement_configs" )) {
20632061 result .PlacementConfigs = tmp
20642062 }
20652063 }
20662064
2067- if size , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "size" )); ok {
2065+ if nodePoolPodNetworkOptionDetails , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "node_pool_pod_network_option_details" )); ok && s .D .HasChange (fmt .Sprintf (fieldKeyFormat , "node_pool_pod_network_option_details" )) {
2066+ if tmpList := nodePoolPodNetworkOptionDetails .([]interface {}); len (tmpList ) > 0 {
2067+ fieldKeyFormatNextLevel := fmt .Sprintf ("%s.%d.%%s" , fmt .Sprintf (fieldKeyFormat , "node_pool_pod_network_option_details" ), 0 )
2068+ tmp , err := s .mapToNodePoolPodNetworkOptionDetails (fieldKeyFormatNextLevel )
2069+ if err != nil {
2070+ return result , err
2071+ }
2072+ result .NodePoolPodNetworkOptionDetails = tmp
2073+ }
2074+ }
2075+
2076+ if size , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "size" )); ok && s .D .HasChange (fmt .Sprintf (fieldKeyFormat , "size" )) {
20682077 tmp := size .(int )
20692078 result .Size = & tmp
20702079 }
20712080
2072- if isPvEncryptionInTransitEnabled , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "is_pv_encryption_in_transit_enabled" )); ok {
2081+ if isPvEncryptionInTransitEnabled , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "is_pv_encryption_in_transit_enabled" )); ok && s . D . HasChange ( fmt . Sprintf ( fieldKeyFormat , "is_pv_encryption_in_transit_enabled" )) {
20732082 tmp := isPvEncryptionInTransitEnabled .(bool )
20742083 result .IsPvEncryptionInTransitEnabled = & tmp
20752084 }
20762085
2077- if kmsKeyId , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "kms_key_id" )); ok {
2086+ if kmsKeyId , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "kms_key_id" )); ok && s . D . HasChange ( fmt . Sprintf ( fieldKeyFormat , "kms_key_id" )) {
20782087 tmp := kmsKeyId .(string )
20792088 result .KmsKeyId = & tmp
20802089 }
2081- if definedTags , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "defined_tags" )); ok {
2090+ if definedTags , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "defined_tags" )); ok && s . D . HasChange ( fmt . Sprintf ( fieldKeyFormat , "defined_tags" )) {
20822091 tmp , err := tfresource .MapToDefinedTags (definedTags .(map [string ]interface {}))
20832092 if err != nil {
20842093 return result , fmt .Errorf ("unable to convert defined_tags, encountered error: %v" , err )
20852094 }
20862095 result .DefinedTags = tmp
20872096 }
20882097
2089- if freeformTags , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "freeform_tags" )); ok {
2098+ if freeformTags , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "freeform_tags" )); ok && s . D . HasChange ( fmt . Sprintf ( fieldKeyFormat , "freeform_tags" )) {
20902099 result .FreeformTags = tfresource .ObjectMapToStringMap (freeformTags .(map [string ]interface {}))
20912100 }
20922101
0 commit comments