mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 17:31:31 +02:00
Fix: do not install k8s ns ACL rules if cluster IP has invalid value
Change-Id: I18cc9351f953444d1ec48e0042e1556f0115a8dc
This commit is contained in:
parent
afe47c2eae
commit
c51f1872e3
@ -53,6 +53,9 @@ public final class Constants {
|
||||
public static final String A_CLASS = "a";
|
||||
public static final String B_CLASS = "b";
|
||||
|
||||
public static final String DEFAULT_SERVICE_IP_CIDR = "10.96.0.0/12";
|
||||
public static final String DEFAULT_SERVICE_IP_NONE = "none";
|
||||
|
||||
public static final String PORT_NAME_PREFIX_CONTAINER = "veth";
|
||||
|
||||
public static final String ANNOTATION_NETWORK_ID = "networkId";
|
||||
|
@ -84,6 +84,7 @@ import static org.onosproject.k8snetworking.api.Constants.ACL_TABLE;
|
||||
import static org.onosproject.k8snetworking.api.Constants.DEFAULT_METADATA_MASK;
|
||||
import static org.onosproject.k8snetworking.api.Constants.DEFAULT_NAMESPACE_HASH;
|
||||
import static org.onosproject.k8snetworking.api.Constants.DEFAULT_SEGMENT_ID;
|
||||
import static org.onosproject.k8snetworking.api.Constants.DEFAULT_SERVICE_IP_NONE;
|
||||
import static org.onosproject.k8snetworking.api.Constants.GROUPING_TABLE;
|
||||
import static org.onosproject.k8snetworking.api.Constants.K8S_NETWORKING_APP_ID;
|
||||
import static org.onosproject.k8snetworking.api.Constants.NAMESPACE_TABLE;
|
||||
@ -812,6 +813,12 @@ public class K8sNetworkPolicyHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// one the creating of new service, the cluster IP will be configured as None
|
||||
// in this case, we will NOT install any namespace related rules
|
||||
if (DEFAULT_SERVICE_IP_NONE.equalsIgnoreCase(clusterIp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setNamespaceRulesBase(clusterIp, namespaceHashByServiceIp(k8sServiceService,
|
||||
k8sNamespaceService, clusterIp), install);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user