mirror of
https://github.com/rancher/plugins.git
synced 2025-09-03 23:15:19 +00:00
go.mod github.com/Microsoft/hcsshim v0.8.16
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
16
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go
generated
vendored
16
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go
generated
vendored
@@ -2,9 +2,9 @@ package hns
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net"
|
||||
|
||||
"errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"net"
|
||||
)
|
||||
|
||||
// Subnet is assoicated with a network and represents a list
|
||||
@@ -39,12 +39,6 @@ type HNSNetwork struct {
|
||||
AutomaticDNS bool `json:",omitempty"`
|
||||
}
|
||||
|
||||
type hnsNetworkResponse struct {
|
||||
Success bool
|
||||
Error string
|
||||
Output HNSNetwork
|
||||
}
|
||||
|
||||
type hnsResponse struct {
|
||||
Success bool
|
||||
Error string
|
||||
@@ -98,6 +92,12 @@ func (network *HNSNetwork) Create() (*HNSNetwork, error) {
|
||||
title := "hcsshim::HNSNetwork::" + operation
|
||||
logrus.Debugf(title+" id=%s", network.Id)
|
||||
|
||||
for _, subnet := range network.Subnets {
|
||||
if (subnet.AddressPrefix != "") && (subnet.GatewayAddress == "") {
|
||||
return nil, errors.New("network create error, subnet has address prefix but no gateway specified")
|
||||
}
|
||||
}
|
||||
|
||||
jsonString, err := json.Marshal(network)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user