Skip to content

Commit

Permalink
add additional policy string in grpc message (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
clu2xlu authored May 17, 2021
1 parent 34bc565 commit 8163906
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mizar/arktos/arktos_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
1 change: 1 addition & 0 deletions mizar/proto/mizar/proto/builtins.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ message BuiltinsNetworkPolicyMessage {
string name = 1;
string namespace = 2;
string tenant = 3;
string policy = 4;
}

message PortsMessage {
Expand Down

0 comments on commit 8163906

Please sign in to comment.