From 4e7e7e43cb992658e12db9a8c22582024642f822 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 6765aaead5..994ab81bb7 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 - InternalPort uint16 - ExternalPort uint16 + Type PolicyType `json:"Type"` + Protocol string + InternalPort uint16 + ExternalPort uint16 + 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 6765aaead5..b6cdcc269a 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 - InternalPort uint16 - ExternalPort uint16 + Type PolicyType `json:"Type"` + Protocol string + InternalPort uint16 + ExternalPort uint16 + ExternalPortReserved bool `json:",omitempty"` } type QosPolicy struct {