Skip to content

Commit

Permalink
use generic func to convert slices of a type to slices of interface
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Feb 27, 2023
1 parent 62dc838 commit 50a7811
Show file tree
Hide file tree
Showing 39 changed files with 113 additions and 125 deletions.
2 changes: 1 addition & 1 deletion resources/packs/azure/azure_cloud_defender.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (a *mqlAzureSubscriptionCloudDefenderService) GetSecurityContacts() (interf
mqlSecurityContact, err := a.MotorRuntime.CreateResource("azure.subscription.cloudDefenderService.securityContact",
"id", core.ToString(contact.ID),
"name", core.ToString(contact.Name),
"emails", core.StrSliceToInterface(strings.Split(mails, ";")),
"emails", core.SliceToInterfaceSlice(strings.Split(mails, ";")),
"notificationsByRole", notificationsByRole,
"alertNotifications", alertNotifications,
)
Expand Down
2 changes: 1 addition & 1 deletion resources/packs/azure/azure_rm_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (a *mqlAzureSubscriptionSqlServiceServer) GetVulnerabilityAssessmentSetting
"storageAccountAccessKey", core.ToString(vaSettings.Properties.StorageAccountAccessKey),
"storageContainerSasKey", core.ToString(vaSettings.Properties.StorageContainerSasKey),
"recurringScanEnabled", core.ToBool(vaSettings.Properties.RecurringScans.IsEnabled),
"recurringScanEmails", core.PtrStrSliceToInterface(vaSettings.Properties.RecurringScans.Emails),
"recurringScanEmails", core.PtrSliceToInterfaceSlice(vaSettings.Properties.RecurringScans.Emails),
"mailSubscriptionAdmins", core.ToBool(vaSettings.Properties.RecurringScans.EmailSubscriptionAdmins),
)
}
Expand Down
2 changes: 1 addition & 1 deletion resources/packs/core/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ func (a *mqlAsset) GetIds() ([]interface{}, error) {
if asset == nil {
return nil, errors.New("unimplemented")
}
return StrSliceToInterface(asset.PlatformIds), nil
return SliceToInterfaceSlice(asset.PlatformIds), nil
}
20 changes: 10 additions & 10 deletions resources/packs/core/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ func pkixnameToMql(runtime *resources.Runtime, name pkix.Name, id string) (PkixN
"dn", name.String(),
"serialNumber", name.SerialNumber,
"commonName", name.CommonName,
"country", StrSliceToInterface(name.Country),
"organization", StrSliceToInterface(name.Organization),
"organizationalUnit", StrSliceToInterface(name.OrganizationalUnit),
"locality", StrSliceToInterface(name.Locality),
"province", StrSliceToInterface(name.Province),
"streetAddress", StrSliceToInterface(name.StreetAddress),
"postalCode", StrSliceToInterface(name.PostalCode),
"country", SliceToInterfaceSlice(name.Country),
"organization", SliceToInterfaceSlice(name.Organization),
"organizationalUnit", SliceToInterfaceSlice(name.OrganizationalUnit),
"locality", SliceToInterfaceSlice(name.Locality),
"province", SliceToInterfaceSlice(name.Province),
"streetAddress", SliceToInterfaceSlice(name.StreetAddress),
"postalCode", SliceToInterfaceSlice(name.PostalCode),
"names", names,
"extraNames", extraNames,
)
Expand Down Expand Up @@ -383,17 +383,17 @@ func (s *mqlCertificate) GetSignature() (string, error) {

func (s *mqlCertificate) GetCrlDistributionPoints() ([]interface{}, error) {
cert := s.getGoCert()
return StrSliceToInterface(cert.CRLDistributionPoints), nil
return SliceToInterfaceSlice(cert.CRLDistributionPoints), nil
}

func (s *mqlCertificate) GetOcspServer() ([]interface{}, error) {
cert := s.getGoCert()
return StrSliceToInterface(cert.OCSPServer), nil
return SliceToInterfaceSlice(cert.OCSPServer), nil
}

func (s *mqlCertificate) GetIssuingCertificateUrl() ([]interface{}, error) {
cert := s.getGoCert()
return StrSliceToInterface(cert.IssuingCertificateURL), nil
return SliceToInterfaceSlice(cert.IssuingCertificateURL), nil
}

func (s *mqlCertificate) GetIsRevoked() (bool, error) {
Expand Down
12 changes: 6 additions & 6 deletions resources/packs/core/core.utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ func ToBool(b *bool) bool {
return *b
}

func StrSliceToInterface(value []string) []interface{} {
res := make([]interface{}, len(value))
for i := range value {
res[i] = value[i]
func SliceToInterfaceSlice[T any](ss []T) []interface{} {
ssI := make([]interface{}, 0, len(ss))
for _, s := range ss {
ssI = append(ssI, s)
}
return res
return ssI
}

func PtrStrSliceToInterface(value []*string) []interface{} {
func PtrSliceToInterfaceSlice(value []*string) []interface{} {
res := make([]interface{}, len(value))
for i := range value {
if value[i] != nil {
Expand Down
8 changes: 4 additions & 4 deletions resources/packs/core/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (d *mqlDomainName) init(args *resources.Args) (*resources.Args, DomainName,
(*args)["effectiveTLDPlusOne"] = dn.EffectiveTLDPlusOne
(*args)["tld"] = dn.TLD
(*args)["tldIcannManaged"] = dn.IcannManagedTLD
(*args)["labels"] = StrSliceToInterface(dn.Labels)
(*args)["labels"] = SliceToInterfaceSlice(dn.Labels)

return args, nil, nil
}
Expand Down Expand Up @@ -236,12 +236,12 @@ func (d *mqlDns) GetDkim(params interface{}) ([]interface{}, error) {
"domain", name,
"dnsTxt", entry,
"version", dkimRepr.Version,
"hashAlgorithms", StrSliceToInterface(dkimRepr.HashAlgorithms),
"hashAlgorithms", SliceToInterfaceSlice(dkimRepr.HashAlgorithms),
"keyType", dkimRepr.KeyType,
"notes", dkimRepr.Notes,
"publicKeyData", dkimRepr.PublicKeyData,
"serviceTypes", StrSliceToInterface(dkimRepr.ServiceType),
"flags", StrSliceToInterface(dkimRepr.Flags),
"serviceTypes", SliceToInterfaceSlice(dkimRepr.ServiceType),
"flags", SliceToInterfaceSlice(dkimRepr.Flags),
)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion resources/packs/core/mondoo.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ func (m *mqlMondooAsset) GetPlatformIDs() ([]interface{}, error) {
if asset == nil {
return nil, errors.New("unimplemented")
}
return StrSliceToInterface(asset.PlatformIds), nil
return SliceToInterfaceSlice(asset.PlatformIds), nil
}
2 changes: 1 addition & 1 deletion resources/packs/gcp/access_approval.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func accessApprovalSettings(motorProvider providers.Instance, runtime *resources

return runtime.CreateResource("gcp.accessApprovalSettings",
"resourcePath", settings.Name,
"notificationEmails", core.StrSliceToInterface(settings.NotificationEmails),
"notificationEmails", core.SliceToInterfaceSlice(settings.NotificationEmails),
"enrolledServices", mqlEnrolledServices,
"enrolledAncestor", settings.EnrolledAncestor,
"activeKeyVersion", settings.ActiveKeyVersion,
Expand Down
2 changes: 1 addition & 1 deletion resources/packs/gcp/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (g *mqlGcpProjectBigqueryServiceDataset) GetTables() ([]interface{}, error)

var clusteringFields []interface{}
if metadata.Clustering != nil {
clusteringFields = core.StrSliceToInterface(metadata.Clustering.Fields)
clusteringFields = core.SliceToInterfaceSlice(metadata.Clustering.Fields)
}

externalDataConfig, err := core.JsonToDict(metadata.ExternalDataConfig)
Expand Down
4 changes: 2 additions & 2 deletions resources/packs/gcp/cloudrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ func mqlContainers(runtime *resources.Runtime, containers []*runpb.Container, te
"id", containerId,
"name", c.Name,
"image", c.Image,
"command", core.StrSliceToInterface(c.Command),
"args", core.StrSliceToInterface(c.Args),
"command", core.SliceToInterfaceSlice(c.Command),
"args", core.SliceToInterfaceSlice(c.Args),
"env", mqlEnvs,
"resources", mqlResources,
"ports", mqlPorts,
Expand Down
60 changes: 30 additions & 30 deletions resources/packs/gcp/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (g *mqlGcpProjectComputeServiceInstance) GetMachineType() (interface{}, err
func newMqlServiceAccount(runtime *resources.Runtime, sa *compute.ServiceAccount) (interface{}, error) {
return runtime.CreateResource("gcp.project.computeService.serviceaccount",
"email", sa.Email,
"scopes", core.StrSliceToInterface(sa.Scopes),
"scopes", core.SliceToInterfaceSlice(sa.Scopes),
)
}

Expand All @@ -366,10 +366,10 @@ func newMqlAttachedDisk(id string, projectId string, runtime *resources.Runtime,
"deviceName", attachedDisk.DeviceName,
"diskSizeGb", attachedDisk.DiskSizeGb,
"forceAttach", attachedDisk.ForceAttach,
"guestOsFeatures", core.StrSliceToInterface(guestOsFeatures),
"guestOsFeatures", core.SliceToInterfaceSlice(guestOsFeatures),
"index", attachedDisk.Index,
"interface", attachedDisk.Interface,
"licenses", core.StrSliceToInterface(attachedDisk.Licenses),
"licenses", core.SliceToInterfaceSlice(attachedDisk.Licenses),
"mode", attachedDisk.Mode,
"type", attachedDisk.Type,
)
Expand Down Expand Up @@ -519,7 +519,7 @@ func newMqlInstance(projectId string, zone GcpProjectComputeServiceZone, runtime
"networkInterfaces", networkInterfaces,
"privateIpv6GoogleAccess", instance.PrivateIpv6GoogleAccess,
"reservationAffinity", reservationAffinity,
"resourcePolicies", core.StrSliceToInterface(instance.ResourcePolicies),
"resourcePolicies", core.SliceToInterfaceSlice(instance.ResourcePolicies),
"physicalHostResourceStatus", physicalHost,
"scheduling", scheduling,
"enableIntegrityMonitoring", enableIntegrityMonitoring,
Expand All @@ -529,7 +529,7 @@ func newMqlInstance(projectId string, zone GcpProjectComputeServiceZone, runtime
"status", instance.Status,
"statusMessage", instance.StatusMessage,
"sourceMachineImage", instance.SourceMachineImage,
"tags", core.StrSliceToInterface(instance.Tags.Items),
"tags", core.SliceToInterfaceSlice(instance.Tags.Items),
"totalEgressBandwidthTier", totalEgressBandwidthTier,
"serviceAccounts", mqlServiceAccounts,
"disks", attachedDisks,
Expand Down Expand Up @@ -697,18 +697,18 @@ func (g *mqlGcpProjectComputeService) GetDisks() ([]interface{}, error) {
"name", disk.Name,
"architecture", disk.Architecture,
"description", disk.Description,
"guestOsFeatures", core.StrSliceToInterface(guestOsFeatures),
"guestOsFeatures", core.SliceToInterfaceSlice(guestOsFeatures),
"labels", core.StrMapToInterface(disk.Labels),
"lastAttachTimestamp", parseTime(disk.LastAttachTimestamp),
"lastDetachTimestamp", parseTime(disk.LastDetachTimestamp),
"locationHint", disk.LocationHint,
"licenses", core.StrSliceToInterface(disk.Licenses),
"licenses", core.SliceToInterfaceSlice(disk.Licenses),
"physicalBlockSizeBytes", disk.PhysicalBlockSizeBytes,
"provisionedIops", disk.ProvisionedIops,
// TODO: link to resources
//"region", disk.Region,
//"replicaZones", core.StrSliceToInterface(disk.ReplicaZones),
//"resourcePolicies", core.StrSliceToInterface(disk.ResourcePolicies),
//"replicaZones", core.SliceToInterfaceSlice(disk.ReplicaZones),
//"resourcePolicies", core.SliceToInterfaceSlice(disk.ResourcePolicies),
"sizeGb", disk.SizeGb,
// TODO: link to resources
//"sourceDiskId", disk.SourceDiskId,
Expand Down Expand Up @@ -852,11 +852,11 @@ func (g *mqlGcpProjectComputeService) GetFirewalls() ([]interface{}, error) {
"priority", firewall.Priority,
"disabled", firewall.Disabled,
"direction", firewall.Direction,
"sourceRanges", core.StrSliceToInterface(firewall.SourceRanges),
"sourceServiceAccounts", core.StrSliceToInterface(firewall.SourceServiceAccounts),
"sourceTags", core.StrSliceToInterface(firewall.SourceTags),
"destinationRanges", core.StrSliceToInterface(firewall.DestinationRanges),
"targetServiceAccounts", core.StrSliceToInterface(firewall.TargetServiceAccounts),
"sourceRanges", core.SliceToInterfaceSlice(firewall.SourceRanges),
"sourceServiceAccounts", core.SliceToInterfaceSlice(firewall.SourceServiceAccounts),
"sourceTags", core.SliceToInterfaceSlice(firewall.SourceTags),
"destinationRanges", core.SliceToInterfaceSlice(firewall.DestinationRanges),
"targetServiceAccounts", core.SliceToInterfaceSlice(firewall.TargetServiceAccounts),
"created", parseTime(firewall.CreationTimestamp),
"allowed", allowedDict,
"denied", deniedDict,
Expand Down Expand Up @@ -929,7 +929,7 @@ func (g *mqlGcpProjectComputeService) GetSnapshots() ([]interface{}, error) {
"storageBytes", snapshot.StorageBytes,
"storageBytesStatus", snapshot.StorageBytesStatus,
"snapshotType", snapshot.SnapshotType,
"licenses", core.StrSliceToInterface(snapshot.Licenses),
"licenses", core.SliceToInterfaceSlice(snapshot.Licenses),
"labels", core.StrMapToInterface(snapshot.Labels),
"status", snapshot.Status,
"created", parseTime(snapshot.CreationTimestamp),
Expand Down Expand Up @@ -1039,7 +1039,7 @@ func (g *mqlGcpProjectComputeService) GetImages() ([]interface{}, error) {
"archiveSizeBytes", image.ArchiveSizeBytes,
"diskSizeGb", image.DiskSizeGb,
"family", image.Family,
"licenses", core.StrSliceToInterface(image.Licenses),
"licenses", core.SliceToInterfaceSlice(image.Licenses),
"labels", core.StrMapToInterface(image.Labels),
"status", image.Status,
"created", parseTime(image.CreationTimestamp),
Expand Down Expand Up @@ -1189,7 +1189,7 @@ func (g *mqlGcpProjectComputeService) GetNetworks() ([]interface{}, error) {
"peerings", peerings,
"routingMode", routingMode,
"mode", networkMode(network),
"subnetworkUrls", core.StrSliceToInterface(network.Subnetworks),
"subnetworkUrls", core.SliceToInterfaceSlice(network.Subnetworks),
)
if err != nil {
return err
Expand Down Expand Up @@ -1346,7 +1346,7 @@ func newMqlSubnetwork(projectId string, runtime *resources.Runtime, subnetwork *
"filterExpression", subnetwork.LogConfig.GetFilterExpr(),
"flowSampling", float64(subnetwork.LogConfig.GetFlowSampling()),
"metadata", subnetwork.LogConfig.GetMetadata(),
"metadataFields", core.StrSliceToInterface(subnetwork.LogConfig.MetadataFields),
"metadataFields", core.SliceToInterfaceSlice(subnetwork.LogConfig.MetadataFields),
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1605,12 +1605,12 @@ func (g *mqlGcpProjectComputeService) GetBackendServices() ([]interface{}, error
if b.CdnPolicy.CacheKeyPolicy != nil {
mqlCacheKeyPolicy = map[string]interface{}{
"includeHost": b.CdnPolicy.CacheKeyPolicy.IncludeHost,
"includeHttpHeaders": core.StrSliceToInterface(b.CdnPolicy.CacheKeyPolicy.IncludeHttpHeaders),
"includeNamedCookies": core.StrSliceToInterface(b.CdnPolicy.CacheKeyPolicy.IncludeNamedCookies),
"includeHttpHeaders": core.SliceToInterfaceSlice(b.CdnPolicy.CacheKeyPolicy.IncludeHttpHeaders),
"includeNamedCookies": core.SliceToInterfaceSlice(b.CdnPolicy.CacheKeyPolicy.IncludeNamedCookies),
"includeProtocol": b.CdnPolicy.CacheKeyPolicy.IncludeProtocol,
"includeQueryString": b.CdnPolicy.CacheKeyPolicy.IncludeQueryString,
"queryStringBlacklist": core.StrSliceToInterface(b.CdnPolicy.CacheKeyPolicy.QueryStringBlacklist),
"queryStringWhitelist": core.StrSliceToInterface(b.CdnPolicy.CacheKeyPolicy.QueryStringWhitelist),
"queryStringBlacklist": core.SliceToInterfaceSlice(b.CdnPolicy.CacheKeyPolicy.QueryStringBlacklist),
"queryStringWhitelist": core.SliceToInterfaceSlice(b.CdnPolicy.CacheKeyPolicy.QueryStringWhitelist),
}
}

Expand All @@ -1636,7 +1636,7 @@ func (g *mqlGcpProjectComputeService) GetBackendServices() ([]interface{}, error
"requestCoalescing", b.CdnPolicy.RequestCoalescing,
"serveWhileStale", b.CdnPolicy.ServeWhileStale,
"signedUrlCacheMaxAgeSec", b.CdnPolicy.SignedUrlCacheMaxAgeSec,
"signedUrlKeyNames", core.StrSliceToInterface(b.CdnPolicy.SignedUrlKeyNames),
"signedUrlKeyNames", core.SliceToInterfaceSlice(b.CdnPolicy.SignedUrlKeyNames),
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1737,7 +1737,7 @@ func (g *mqlGcpProjectComputeService) GetBackendServices() ([]interface{}, error
if b.SecuritySettings != nil {
mqlSecuritySettings = map[string]interface{}{
"clientTlsPolicy": b.SecuritySettings.ClientTlsPolicy,
"subjectAltNames": core.StrSliceToInterface(b.SecuritySettings.SubjectAltNames),
"subjectAltNames": core.SliceToInterfaceSlice(b.SecuritySettings.SubjectAltNames),
}
}

Expand All @@ -1757,13 +1757,13 @@ func (g *mqlGcpProjectComputeService) GetBackendServices() ([]interface{}, error
"connectionTrackingPolicy", mqlConnectionTrackingPolicy,
"consistentHash", mqlConsistentHash,
"created", parseTime(b.CreationTimestamp),
"customRequestHeaders", core.StrSliceToInterface(b.CustomRequestHeaders),
"customResponseHeaders", core.StrSliceToInterface(b.CustomResponseHeaders),
"customRequestHeaders", core.SliceToInterfaceSlice(b.CustomRequestHeaders),
"customResponseHeaders", core.SliceToInterfaceSlice(b.CustomResponseHeaders),
"description", b.Description,
"edgeSecurityPolicy", b.EdgeSecurityPolicy,
"enableCDN", b.EnableCDN,
"failoverPolicy", mqlFailoverPolicy,
"healthChecks", core.StrSliceToInterface(b.HealthChecks),
"healthChecks", core.SliceToInterfaceSlice(b.HealthChecks),
"iap", mqlIap,
"loadBalancingScheme", b.LoadBalancingScheme,
"localityLbPolicies", mqlLocalityLbPolicy,
Expand All @@ -1777,7 +1777,7 @@ func (g *mqlGcpProjectComputeService) GetBackendServices() ([]interface{}, error
"regionUrl", b.Region,
"securityPolicyUrl", b.SecurityPolicy,
"securitySettings", mqlSecuritySettings,
"serviceBindingUrls", core.StrSliceToInterface(b.ServiceBindings),
"serviceBindingUrls", core.SliceToInterfaceSlice(b.ServiceBindings),
"sessionAffinity", b.SessionAffinity,
"timeoutSec", b.TimeoutSec,
)
Expand Down Expand Up @@ -1861,7 +1861,7 @@ func (g *mqlGcpProjectComputeService) GetAddresses() ([]interface{}, error) {
"regionUrl", a.Region,
"status", a.Status,
"subnetworkUrl", a.Subnetwork,
"resourceUrls", core.StrSliceToInterface(a.Users),
"resourceUrls", core.SliceToInterfaceSlice(a.Users),
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1967,7 +1967,7 @@ func (g *mqlGcpProjectComputeService) GetForwardingRules() ([]interface{}, error
"networkTier", fwr.GetNetworkTier(),
"noAutomateDnsZone", fwr.GetNoAutomateDnsZone(),
"portRange", fwr.GetPortRange(),
"ports", core.StrSliceToInterface(fwr.GetPorts()),
"ports", core.SliceToInterfaceSlice(fwr.GetPorts()),
"regionUrl", fwr.GetRegion(),
"serviceDirectoryRegistrations", serviceDirRegs,
"serviceLabel", fwr.GetServiceLabel(),
Expand Down
8 changes: 4 additions & 4 deletions resources/packs/gcp/dataproc.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (g *mqlGcpProjectDataprocService) GetClusters() ([]interface{}, error) {
"id", fmt.Sprintf("%s/dataproc/%s/config/gceCluster/reservationAffinity", projectId, c.ClusterName),
"consumeReservationType", c.Config.GceClusterConfig.ReservationAffinity.ConsumeReservationType,
"key", c.Config.GceClusterConfig.ReservationAffinity.Key,
"values", core.StrSliceToInterface(c.Config.GceClusterConfig.ReservationAffinity.Values),
"values", core.SliceToInterfaceSlice(c.Config.GceClusterConfig.ReservationAffinity.Values),
)
if err != nil {
log.Error().Err(err).Send()
Expand Down Expand Up @@ -294,10 +294,10 @@ func (g *mqlGcpProjectDataprocService) GetClusters() ([]interface{}, error) {
"privateIpv6GoogleAccess", c.Config.GceClusterConfig.PrivateIpv6GoogleAccess,
"reservationAffinity", mqlReservationAffinity,
"serviceAccount", c.Config.GceClusterConfig.ServiceAccount,
"serviceAccountScopes", core.StrSliceToInterface(c.Config.GceClusterConfig.ServiceAccountScopes),
"serviceAccountScopes", core.SliceToInterfaceSlice(c.Config.GceClusterConfig.ServiceAccountScopes),
"shieldedInstanceConfig", mqlShieldedCfg,
"subnetworkUri", c.Config.GceClusterConfig.SubnetworkUri,
"tags", core.StrSliceToInterface(c.Config.GceClusterConfig.Tags),
"tags", core.SliceToInterfaceSlice(c.Config.GceClusterConfig.Tags),
"zoneUri", c.Config.GceClusterConfig.ZoneUri,
)
if err != nil {
Expand Down Expand Up @@ -785,7 +785,7 @@ func instaceGroupConfigToMql(runtime *resources.Runtime, igc *dataproc.InstanceG
"accelerators", mqlAccs,
"diskConfig", mqlDiskCfg,
"imageUri", igc.ImageUri,
"instanceNames", core.StrSliceToInterface(igc.InstanceNames),
"instanceNames", core.SliceToInterfaceSlice(igc.InstanceNames),
"instanceReferences", mqlInstanceRefs,
"isPreemptible", igc.IsPreemptible,
"machineTypeUri", igc.MachineTypeUri,
Expand Down
6 changes: 3 additions & 3 deletions resources/packs/gcp/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (g *mqlGcpProjectDnsService) GetManagedZones() ([]interface{}, error) {
"dnssecConfig", mqlDnssecCfg,
"dnsName", managedZone.DnsName,
"nameServerSet", managedZone.NameServerSet,
"nameServers", core.StrSliceToInterface(managedZone.NameServers),
"nameServers", core.SliceToInterfaceSlice(managedZone.NameServers),
"visibility", managedZone.Visibility,
"created", parseTime(managedZone.CreationTime),
)
Expand Down Expand Up @@ -288,8 +288,8 @@ func (g *mqlGcpProjectDnsServiceManagedzone) GetRecordSets() ([]interface{}, err
mqlDnsPolicy, err := g.MotorRuntime.CreateResource("gcp.project.dnsService.recordset",
"projectId", projectId,
"name", rSet.Name,
"rrdatas", core.StrSliceToInterface(rSet.Rrdatas),
"signatureRrdatas", core.StrSliceToInterface(rSet.SignatureRrdatas),
"rrdatas", core.SliceToInterfaceSlice(rSet.Rrdatas),
"signatureRrdatas", core.SliceToInterfaceSlice(rSet.SignatureRrdatas),
"ttl", rSet.Ttl,
"type", rSet.Type,
)
Expand Down
Loading

0 comments on commit 50a7811

Please sign in to comment.