Add missing network resource in account copy

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2024-12-10 16:49:32 +01:00
parent 382dba4a85
commit a52ef1a066
2 changed files with 18 additions and 0 deletions
@@ -49,6 +49,18 @@ func NewNetworkResource(accountID, networkID, name, description, address string)
}, nil
}
func (n *NetworkResource) Copy() *NetworkResource {
return &NetworkResource{
ID: n.ID,
AccountID: n.AccountID,
NetworkID: n.NetworkID,
Name: n.Name,
Description: n.Description,
Type: n.Type,
Address: n.Address,
}
}
// getResourceType returns the type of the resource based on the address
func getResourceType(address string) (NetworkResourceType, error) {
if ip, cidr, err := net.ParseCIDR(address); err == nil {