diff --git a/mizar/arktos/arktos_service.py b/mizar/arktos/arktos_service.py index 8c8e3216..b97f34ba 100644 --- a/mizar/arktos/arktos_service.py +++ b/mizar/arktos/arktos_service.py @@ -147,6 +147,7 @@ def CreateNetworkPolicy(self, request, context): param.body['metadata'] = {} param.body['metadata']['namespace'] = request.namespace param.body['metadata']['tenant'] = request.tenant + param.spec = json.loads(request.policy) param.extra = {} return run_arktos_workflow(wffactory().k8sNetworkPolicyCreate(param=param)) diff --git a/mizar/dp/mizar/workflows/builtins/networkpolicies/create.py b/mizar/dp/mizar/workflows/builtins/networkpolicies/create.py index b5448cad..f34906cf 100644 --- a/mizar/dp/mizar/workflows/builtins/networkpolicies/create.py +++ b/mizar/dp/mizar/workflows/builtins/networkpolicies/create.py @@ -35,6 +35,7 @@ def requires(self): def run(self): logger.info("Run {task}".format(task=self.__class__.__name__)) + logger.info("Network Policy Spec: {}".format(self.param.spec)) policy_name = "{}:{}".format(self.param.namespace, self.param.name) pod_label_dict = self.param.spec["podSelector"]["matchLabels"] if "matchLabels" in self.param.spec["podSelector"] else {} diff --git a/mizar/proto/mizar/proto/builtins.proto b/mizar/proto/mizar/proto/builtins.proto index 67341fe9..5e49a666 100644 --- a/mizar/proto/mizar/proto/builtins.proto +++ b/mizar/proto/mizar/proto/builtins.proto @@ -77,6 +77,7 @@ message BuiltinsNetworkPolicyMessage { string name = 1; string namespace = 2; string tenant = 3; + string policy = 4; } message PortsMessage {