0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-24 20:38:34 +00:00
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-07-30 22:43:59 -04:00
parent 67a5481047
commit e86fce1c13
No known key found for this signature in database
GPG Key ID: 637146A2A6804C59
2 changed files with 5 additions and 0 deletions

View File

@ -131,6 +131,7 @@ func (d *genericZoneDataSource) Read(ctx context.Context, req datasource.ReadReq
"SDN Zone Not Found",
fmt.Sprintf("SDN zone with ID '%s' was not found", state.getID()),
)
return
}
@ -153,6 +154,7 @@ func (d *genericZoneDataSource) Read(ctx context.Context, req datasource.ReadReq
zone.ID,
),
)
return
}

View File

@ -154,13 +154,16 @@ func (d *zonesDataSource) Read(ctx context.Context, req datasource.ReadRequest,
"Unable to Read SDN Zones",
err.Error(),
)
return
}
filteredZones := zonesList
if !data.Type.IsNull() && !data.Type.IsUnknown() {
filterType := data.Type.ValueString()
filteredZones = make([]zones.ZoneData, 0)
for _, zone := range zonesList {
if zone.Type != nil && *zone.Type == filterType {
filteredZones = append(filteredZones, zone)