Skip to content

Commit

Permalink
adapter: find real subnet id if a string was provided (e.g. public ad…
Browse files Browse the repository at this point in the history
…apter)
  • Loading branch information
gxben committed Sep 29, 2023
1 parent 7b8d699 commit f0e01fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/provider/kowabunga_adapter_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ func ipv4MaskString(m []byte) string {
}

func (r *AdapterResource) GetSubnetData(data *AdapterResourceModel) error {
params := subnet.NewGetSubnetParams().WithSubnetID(data.Subnet.ValueString())
// find real subnet id if a string was provided
subnetId, err := getSubnetID(r.Data, data.Subnet.ValueString())
if err != nil {
return err
}

params := subnet.NewGetSubnetParams().WithSubnetID(subnetId)
obj, err := r.Data.K.Subnet.GetSubnet(params, nil)
if err != nil {
return err
Expand Down

0 comments on commit f0e01fd

Please sign in to comment.