Skip to content

Commit 404eb16

Browse files
committed
restrict to only APIPA
1 parent 7758c58 commit 404eb16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cns/NetworkContainerContract.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ type ValidAclPolicySetting struct {
248248
func (networkContainerRequestPolicy *NetworkContainerRequestPolicies) Validate() error {
249249
// validate ACL policy
250250
if networkContainerRequestPolicy != nil {
251-
if strings.EqualFold(networkContainerRequestPolicy.Type, "ACLPolicy") {
251+
if strings.EqualFold(networkContainerRequestPolicy.Type, "ACLPolicy") && strings.EqualFold(networkContainerRequestPolicy.EndpointType, "APIPA") {
252252
var requestedAclPolicy ValidAclPolicySetting
253253
if err := json.Unmarshal(networkContainerRequestPolicy.Settings, &requestedAclPolicy); err != nil {
254254
return fmt.Errorf("ACL policy failed to pass validation with error: %+v ", err)
@@ -259,6 +259,8 @@ func (networkContainerRequestPolicy *NetworkContainerRequestPolicies) Validate()
259259
if requestedAclPolicy.Priority == 0 {
260260
return fmt.Errorf("Priority field cannot be empty in ACL Policy")
261261
}
262+
} else {
263+
return fmt.Errorf("Only ACL Policies on APIPA endpoint supported")
262264
}
263265
}
264266
return nil

0 commit comments

Comments
 (0)