@@ -127,7 +127,10 @@ func platformDoesNotSupportError(featureName string) error {
127127
128128// V2ApiSupported returns an error if the HCN version does not support the V2 Apis.
129129func V2ApiSupported () error {
130- supported := GetSupportedFeatures ()
130+ supported , err := GetCachedSupportedFeatures ()
131+ if err != nil {
132+ return err
133+ }
131134 if supported .Api .V2 {
132135 return nil
133136 }
@@ -143,7 +146,10 @@ func V2SchemaVersion() SchemaVersion {
143146
144147// RemoteSubnetSupported returns an error if the HCN version does not support Remote Subnet policies.
145148func RemoteSubnetSupported () error {
146- supported := GetSupportedFeatures ()
149+ supported , err := GetCachedSupportedFeatures ()
150+ if err != nil {
151+ return err
152+ }
147153 if supported .RemoteSubnet {
148154 return nil
149155 }
@@ -152,7 +158,10 @@ func RemoteSubnetSupported() error {
152158
153159// HostRouteSupported returns an error if the HCN version does not support Host Route policies.
154160func HostRouteSupported () error {
155- supported := GetSupportedFeatures ()
161+ supported , err := GetCachedSupportedFeatures ()
162+ if err != nil {
163+ return err
164+ }
156165 if supported .HostRoute {
157166 return nil
158167 }
@@ -161,7 +170,10 @@ func HostRouteSupported() error {
161170
162171// DSRSupported returns an error if the HCN version does not support Direct Server Return.
163172func DSRSupported () error {
164- supported := GetSupportedFeatures ()
173+ supported , err := GetCachedSupportedFeatures ()
174+ if err != nil {
175+ return err
176+ }
165177 if supported .DSR {
166178 return nil
167179 }
@@ -170,7 +182,10 @@ func DSRSupported() error {
170182
171183// Slash32EndpointPrefixesSupported returns an error if the HCN version does not support configuring endpoints with /32 prefixes.
172184func Slash32EndpointPrefixesSupported () error {
173- supported := GetSupportedFeatures ()
185+ supported , err := GetCachedSupportedFeatures ()
186+ if err != nil {
187+ return err
188+ }
174189 if supported .Slash32EndpointPrefixes {
175190 return nil
176191 }
@@ -179,7 +194,10 @@ func Slash32EndpointPrefixesSupported() error {
179194
180195// AclSupportForProtocol252Supported returns an error if the HCN version does not support HNS ACL Policies to support protocol 252 for VXLAN.
181196func AclSupportForProtocol252Supported () error {
182- supported := GetSupportedFeatures ()
197+ supported , err := GetCachedSupportedFeatures ()
198+ if err != nil {
199+ return err
200+ }
183201 if supported .AclSupportForProtocol252 {
184202 return nil
185203 }
@@ -188,7 +206,10 @@ func AclSupportForProtocol252Supported() error {
188206
189207// SessionAffinitySupported returns an error if the HCN version does not support Session Affinity.
190208func SessionAffinitySupported () error {
191- supported := GetSupportedFeatures ()
209+ supported , err := GetCachedSupportedFeatures ()
210+ if err != nil {
211+ return err
212+ }
192213 if supported .SessionAffinity {
193214 return nil
194215 }
@@ -197,7 +218,10 @@ func SessionAffinitySupported() error {
197218
198219// IPv6DualStackSupported returns an error if the HCN version does not support IPv6DualStack.
199220func IPv6DualStackSupported () error {
200- supported := GetSupportedFeatures ()
221+ supported , err := GetCachedSupportedFeatures ()
222+ if err != nil {
223+ return err
224+ }
201225 if supported .IPv6DualStack {
202226 return nil
203227 }
@@ -206,7 +230,10 @@ func IPv6DualStackSupported() error {
206230
207231//L4proxySupported returns an error if the HCN verison does not support L4Proxy
208232func L4proxyPolicySupported () error {
209- supported := GetSupportedFeatures ()
233+ supported , err := GetCachedSupportedFeatures ()
234+ if err != nil {
235+ return err
236+ }
210237 if supported .L4Proxy {
211238 return nil
212239 }
@@ -215,7 +242,10 @@ func L4proxyPolicySupported() error {
215242
216243// L4WfpProxySupported returns an error if the HCN verison does not support L4WfpProxy
217244func L4WfpProxyPolicySupported () error {
218- supported := GetSupportedFeatures ()
245+ supported , err := GetCachedSupportedFeatures ()
246+ if err != nil {
247+ return err
248+ }
219249 if supported .L4WfpProxy {
220250 return nil
221251 }
@@ -224,7 +254,10 @@ func L4WfpProxyPolicySupported() error {
224254
225255// SetPolicySupported returns an error if the HCN version does not support SetPolicy.
226256func SetPolicySupported () error {
227- supported := GetSupportedFeatures ()
257+ supported , err := GetCachedSupportedFeatures ()
258+ if err != nil {
259+ return err
260+ }
228261 if supported .SetPolicy {
229262 return nil
230263 }
@@ -233,7 +266,10 @@ func SetPolicySupported() error {
233266
234267// VxlanPortSupported returns an error if the HCN version does not support configuring the VXLAN TCP port.
235268func VxlanPortSupported () error {
236- supported := GetSupportedFeatures ()
269+ supported , err := GetCachedSupportedFeatures ()
270+ if err != nil {
271+ return err
272+ }
237273 if supported .VxlanPort {
238274 return nil
239275 }
@@ -242,7 +278,10 @@ func VxlanPortSupported() error {
242278
243279// TierAclPolicySupported returns an error if the HCN version does not support configuring the TierAcl.
244280func TierAclPolicySupported () error {
245- supported := GetSupportedFeatures ()
281+ supported , err := GetCachedSupportedFeatures ()
282+ if err != nil {
283+ return err
284+ }
246285 if supported .TierAcl {
247286 return nil
248287 }
@@ -251,7 +290,10 @@ func TierAclPolicySupported() error {
251290
252291// NetworkACLPolicySupported returns an error if the HCN version does not support NetworkACLPolicy
253292func NetworkACLPolicySupported () error {
254- supported := GetSupportedFeatures ()
293+ supported , err := GetCachedSupportedFeatures ()
294+ if err != nil {
295+ return err
296+ }
255297 if supported .NetworkACL {
256298 return nil
257299 }
@@ -260,14 +302,16 @@ func NetworkACLPolicySupported() error {
260302
261303// NestedIpSetSupported returns an error if the HCN version does not support NestedIpSet
262304func NestedIpSetSupported () error {
263- supported := GetSupportedFeatures ()
305+ supported , err := GetCachedSupportedFeatures ()
306+ if err != nil {
307+ return err
308+ }
264309 if supported .NestedIpSet {
265310 return nil
266311 }
267312 return platformDoesNotSupportError ("NestedIpSet" )
268313}
269314
270-
271315// RequestType are the different operations performed to settings.
272316// Used to update the settings of Endpoint/Namespace objects.
273317type RequestType string
0 commit comments