Skip to content

Commit

Permalink
fix: open api create app use k8s app
Browse files Browse the repository at this point in the history
  • Loading branch information
曲源成 committed Aug 11, 2023
1 parent 1248a5e commit acb1c79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions console/services/group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def create_app(self,
res["group_id"] = app.ID
res['app_id'] = app.ID
res['app_name'] = app.group_name
res['k8s_app'] = app.k8s_app
return res

def create_default_app(self, tenant, region_name):
Expand Down
3 changes: 2 additions & 1 deletion openapi/views/apps/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ def post(self, request, *args, **kwargs):
serializer = AppPostInfoSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
data = serializer.data
k8s_app = request.data.get("k8s_app", "")
group_info = group_service.create_app(
self.team,
self.region_name,
data["app_name"],
data.get("app_note"),
self.user.get_username(),
k8s_app="app-" + make_uuid()[:6],
k8s_app=k8s_app if k8s_app else "app-" + make_uuid()[:6],
)
re = AppBaseInfoSerializer(group_info)
return Response(re.data, status=status.HTTP_201_CREATED)
Expand Down

0 comments on commit acb1c79

Please sign in to comment.