From 9586dc3ed6bdfa96aa1e63cf296b30bc9d169ffb Mon Sep 17 00:00:00 2001 From: Kendall Stratton Date: Tue, 23 Mar 2021 19:44:30 -0700 Subject: [PATCH] Adding ExternalPortReserved flag to NatPolicy for HNS API V1. THis is a flag exposed for docker to avoid port reservation conflict with external port HNS API V2 will use NatFlags to check and see if ExternalPortReserved is set (cherry picked from commit b85f3fdc17dad534a2cebbc67e0c18f77fb0fca8) Signed-off-by: Ameya Gawde --- internal/hns/hnspolicy.go | 9 +++++---- .../Microsoft/hcsshim/internal/hns/hnspolicy.go | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/hns/hnspolicy.go b/internal/hns/hnspolicy.go index a80a0c9ba2..082c018a4e 100644 --- a/internal/hns/hnspolicy.go +++ b/internal/hns/hnspolicy.go @@ -21,10 +21,11 @@ const ( ) type NatPolicy struct { - Type PolicyType `json:"Type"` - Protocol string `json:",omitempty"` - InternalPort uint16 `json:",omitempty"` - ExternalPort uint16 `json:",omitempty"` + Type PolicyType `json:"Type"` + Protocol string `json:",omitempty"` + InternalPort uint16 `json:",omitempty"` + ExternalPort uint16 `json:",omitempty"` + ExternalPortReserved bool `json:",omitempty"` } type QosPolicy struct { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go index a80a0c9ba2..082c018a4e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go @@ -21,10 +21,11 @@ const ( ) type NatPolicy struct { - Type PolicyType `json:"Type"` - Protocol string `json:",omitempty"` - InternalPort uint16 `json:",omitempty"` - ExternalPort uint16 `json:",omitempty"` + Type PolicyType `json:"Type"` + Protocol string `json:",omitempty"` + InternalPort uint16 `json:",omitempty"` + ExternalPort uint16 `json:",omitempty"` + ExternalPortReserved bool `json:",omitempty"` } type QosPolicy struct {