Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS ut fix: strfmt to string conversion to fix broken UT #4671

Merged
merged 12 commits into from
Jul 5, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func dataSourceIBMPrivateDNSGLBMonitorsRead(d *schema.ResourceData, meta interfa
dnsMonitor[pdnsGlbMonitorID] = *instance.ID
dnsMonitor[pdnsGlbMonitorName] = *instance.Name
dnsMonitor[pdnsGlbMonitorType] = *instance.Type
dnsMonitor[pdnsGlbMonitorCreatedOn] = *instance.CreatedOn
dnsMonitor[pdnsGlbMonitorModifiedOn] = *instance.ModifiedOn
dnsMonitor[pdnsGlbMonitorCreatedOn] = (*instance.CreatedOn).String()
dnsMonitor[pdnsGlbMonitorModifiedOn] = (*instance.ModifiedOn).String()
dnsMonitor[pdnsGlbMonitorPort] = *instance.Port
dnsMonitor[pdnsGlbMonitorInterval] = *instance.Interval
dnsMonitor[pdnsGlbMonitorRetries] = *instance.Retries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func dataSourceIBMPrivateDNSGLBPoolsRead(d *schema.ResourceData, meta interface{
dnsPool[pdnsGlbPoolEnabled] = *instance.Enabled
dnsPool[pdnsGlbPoolHealth] = *instance.Health
dnsPool[pdnsGlbPoolHealthyOriginsThreshold] = *instance.HealthyOriginsThreshold
dnsPool[pdnsGlbPoolCreatedOn] = *instance.CreatedOn
dnsPool[pdnsGlbPoolModifiedOn] = *instance.ModifiedOn
dnsPool[pdnsGlbPoolCreatedOn] = (*instance.CreatedOn).String()
dnsPool[pdnsGlbPoolModifiedOn] = (*instance.ModifiedOn).String()
dnsPool[pdnsGlbPoolMonitor] = *instance.Monitor
dnsPool[pdnsGlbPoolChannel] = *instance.NotificationChannel
dnsPool[pdnsGlbPoolRegion] = *instance.HealthcheckRegion
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/data_source_ibm_private_dns_glbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func dataSourceIBMPrivateDNSGLBsRead(d *schema.ResourceData, meta interface{}) e
dnsLoadbalancer[pdnsGLBTTL] = *instance.TTL
dnsLoadbalancer[pdnsGLBHealth] = *instance.Health
dnsLoadbalancer[pdnsGLBFallbackPool] = *instance.FallbackPool
dnsLoadbalancer[pdnsGLBCreatedOn] = *instance.CreatedOn
dnsLoadbalancer[pdnsGLBModifiedOn] = *instance.ModifiedOn
dnsLoadbalancer[pdnsGLBCreatedOn] = (*instance.CreatedOn).String()
dnsLoadbalancer[pdnsGLBModifiedOn] = (*instance.ModifiedOn).String()
dnsLoadbalancer[pdnsGLBDefaultPool] = instance.DefaultPools
dnsLoadbalancer[pdnsGLBAZPools] = flattenPDNSGlbAZpool(instance.AzPools)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func dataSourceIBMPrivateDNSPermittedNetworksRead(d *schema.ResourceData, meta i
permittedNetworkVpcCrn := map[string]interface{}{}
permittedNetwork[pdnsInstanceID] = instanceID
permittedNetwork[pdnsPermittedNetworkID] = instance.ID
permittedNetwork[pdnsPermittedNetworkCreatedOn] = instance.CreatedOn
permittedNetwork[pdnsPermittedNetworkModifiedOn] = instance.ModifiedOn
permittedNetwork[pdnsPermittedNetworkCreatedOn] = instance.CreatedOn.String()
permittedNetwork[pdnsPermittedNetworkModifiedOn] = instance.ModifiedOn.String()
permittedNetwork[pdnsPermittedNetworkState] = instance.State
permittedNetwork[pdnsNetworkType] = instance.Type
permittedNetworkVpcCrn[pdnsVpcCRN] = instance.PermittedNetwork.VpcCrn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func dataSourceIBMDNSSecondaryZonesRead(context context.Context, d *schema.Resou
secondaryZone[pdnsSZZone] = *instance.Zone
secondaryZone[pdnsSZEnabled] = *instance.Enabled
secondaryZone[pdnsSZTransferFrom] = instance.TransferFrom
secondaryZone[pdnsSZCreatedOn] = *instance.CreatedOn
secondaryZone[pdnsSZModifiedOn] = *instance.ModifiedOn
secondaryZone[pdnsSZCreatedOn] = (*instance.CreatedOn).String()
secondaryZone[pdnsSZModifiedOn] = (*instance.ModifiedOn).String()

secondaryZones = append(secondaryZones, secondaryZone)
}
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/data_source_ibm_private_dns_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func dataSourceIBMPrivateDNSZonesRead(d *schema.ResourceData, meta interface{})
dnsZone[pdnsZoneName] = instance.Name
dnsZone[pdnsZoneDescription] = instance.Description
dnsZone[pdnsZoneLabel] = instance.Label
dnsZone[pdnsZoneCreatedOn] = instance.CreatedOn
dnsZone[pdnsZoneModifiedOn] = instance.ModifiedOn
dnsZone[pdnsZoneCreatedOn] = instance.CreatedOn.String()
dnsZone[pdnsZoneModifiedOn] = instance.ModifiedOn.String()
dnsZone[pdnsZoneState] = instance.State
dnsZones = append(dnsZones, dnsZone)
}
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/resource_ibm_dns_linked_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ func resourceIBMDNSLinkedZoneRead(ctx context.Context, d *schema.ResourceData, m
d.Set(DnsLinkedZoneInstanceID, idSet[0])
d.Set(DnsLinkedZoneDescription, *resource.Description)
d.Set(DnsLinkedZoneLabel, *resource.Label)
d.Set(DnsLinkedZoneCreatedOn, resource.CreatedOn)
d.Set(DnsLinkedZoneModifiedOn, resource.ModifiedOn)
d.Set(DnsLinkedZoneCreatedOn, resource.CreatedOn.String())
d.Set(DnsLinkedZoneModifiedOn, resource.ModifiedOn.String())

return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ func resourceIBMPrivateDNSSecondaryZoneRead(ctx context.Context, d *schema.Resou
d.Set(pdnsSecondaryZoneZone, *resource.Zone)
d.Set(pdnsSecondaryZoneTransferFrom, transferFrom)
d.Set(pdnsSecondaryZoneID, *resource.ID)
d.Set(pdnsSecondaryZoneCreatedOn, resource.CreatedOn)
d.Set(pdnsSecondaryZoneModifiedOn, resource.ModifiedOn)
d.Set(pdnsSecondaryZoneCreatedOn, resource.CreatedOn.String())
d.Set(pdnsSecondaryZoneModifiedOn, resource.ModifiedOn.String())
d.Set(pdnsSecondaryZoneEnabled, *resource.Enabled)

return nil
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/resource_ibm_private_dns_glb.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ func resourceIBMPrivateDNSGLBRead(d *schema.ResourceData, meta interface{}) erro
d.Set(pdnsGLBHealth, response.Health)
d.Set(pdnsGLBFallbackPool, response.FallbackPool)
d.Set(pdnsGLBDefaultPool, response.DefaultPools)
d.Set(pdnsGLBCreatedOn, response.CreatedOn)
d.Set(pdnsGLBModifiedOn, response.ModifiedOn)
d.Set(pdnsGLBCreatedOn, response.CreatedOn.String())
d.Set(pdnsGLBModifiedOn, response.ModifiedOn.String())
d.Set(pdnsGLBAZPools, flattenPDNSGlbAZpool(response.AzPools))
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ func resourceIBMPrivateDNSGLBMonitorRead(d *schema.ResourceData, meta interface{
d.Set(pdnsInstanceID, idset[0])
d.Set(pdnsGlbMonitorID, response.ID)
d.Set(pdnsGlbMonitorName, response.Name)
d.Set(pdnsGlbMonitorCreatedOn, response.CreatedOn)
d.Set(pdnsGlbMonitorModifiedOn, response.ModifiedOn)
d.Set(pdnsGlbMonitorCreatedOn, response.CreatedOn.String())
d.Set(pdnsGlbMonitorModifiedOn, response.ModifiedOn.String())
d.Set(pdnsGlbMonitorType, response.Type)
d.Set(pdnsGlbMonitorPort, response.Port)
if response.Path != nil {
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/resource_ibm_private_dns_glb_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ func resourceIBMPrivateDNSGLBPoolRead(d *schema.ResourceData, meta interface{})
d.Set(pdnsGlbPoolChannel, response.NotificationChannel)
d.Set(pdnsGlbPoolRegion, response.HealthcheckRegion)
d.Set(pdnsGlbPoolSubnet, response.HealthcheckSubnets)
d.Set(pdnsGlbPoolCreatedOn, response.CreatedOn)
d.Set(pdnsGlbPoolModifiedOn, response.ModifiedOn)
d.Set(pdnsGlbPoolCreatedOn, response.CreatedOn.String())
d.Set(pdnsGlbPoolModifiedOn, response.ModifiedOn.String())
d.Set(pdnsGlbPoolOrigins, flattenPDNSGlbPoolOrigins(response.Origins))

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func resourceIBMPrivateDNSPermittedNetworkRead(d *schema.ResourceData, meta inte
d.Set(pdnsInstanceID, idSet[0])
d.Set(pdnsZoneID, idSet[1])
d.Set(pdnsPermittedNetworkID, response.ID)
d.Set(pdnsPermittedNetworkCreatedOn, response.CreatedOn)
d.Set(pdnsPermittedNetworkModifiedOn, response.ModifiedOn)
d.Set(pdnsPermittedNetworkCreatedOn, response.CreatedOn.String())
d.Set(pdnsPermittedNetworkModifiedOn, response.ModifiedOn.String())
d.Set(pdnsVpcCRN, response.PermittedNetwork.VpcCrn)
d.Set(pdnsNetworkType, response.Type)
d.Set(pdnsPermittedNetworkState, response.State)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ func resourceIBMPrivateDNSResourceRecordRead(d *schema.ResourceData, meta interf
d.Set(pdnsRecordName, recordName)
d.Set(pdnsRecordType, response.Type)
d.Set(pdnsRecordTTL, response.TTL)
d.Set(pdnsRecordCreatedOn, response.CreatedOn)
d.Set(pdnsRecordModifiedOn, response.ModifiedOn)
d.Set(pdnsRecordCreatedOn, response.CreatedOn.String())
d.Set(pdnsRecordModifiedOn, response.ModifiedOn.String())

if *response.Type == "SRV" {
data := response.Rdata
Expand Down
4 changes: 2 additions & 2 deletions ibm/service/dnsservices/resource_ibm_private_dns_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func resourceIBMPrivateDNSZoneRead(d *schema.ResourceData, meta interface{}) err
d.Set(pdnsZoneName, response.Name)
d.Set(pdnsZoneDescription, response.Description)
d.Set(pdnsZoneLabel, response.Label)
d.Set(pdnsZoneCreatedOn, response.CreatedOn)
d.Set(pdnsZoneModifiedOn, response.ModifiedOn)
d.Set(pdnsZoneCreatedOn, response.CreatedOn.String())
d.Set(pdnsZoneModifiedOn, response.ModifiedOn.String())
d.Set(pdnsZoneState, response.State)

return nil
Expand Down