Skip to content

Commit

Permalink
[Nuclio] Delete nuclio function along with its gateways (#5649)
Browse files Browse the repository at this point in the history
  • Loading branch information
rokatyy committed Jun 2, 2024
1 parent 61fcb2b commit 9925236
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/api/utils/clients/async_nuclio.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
NUCLIO_API_SESSIONS_ENDPOINT = "/api/sessions/"
NUCLIO_API_GATEWAYS_ENDPOINT_TEMPLATE = "/api/api_gateways/{api_gateway}"
NUCLIO_API_GATEWAY_NAMESPACE_HEADER = "X-Nuclio-Api-Gateway-Namespace"
NUCLIO_DELETE_FUNCTIONS_WITH_API_GATEWAYS_HEADER = (
"X-Nuclio-Delete-Function-With-API-Gateways"
)
NUCLIO_FUNCTIONS_ENDPOINT_TEMPLATE = "/api/functions/{function}"
NUCLIO_PROJECT_NAME_HEADER = "X-Nuclio-Project-Name"

Expand Down Expand Up @@ -128,7 +131,8 @@ async def delete_api_gateway(self, name: str, project_name: str = None):
)

async def delete_function(self, name: str, project_name: str = None):
headers = {}
# this header allows nuclio to delete function along with its api gateways
headers = {NUCLIO_DELETE_FUNCTIONS_WITH_API_GATEWAYS_HEADER: "true"}

if project_name:
headers[NUCLIO_PROJECT_NAME_HEADER] = project_name
Expand Down

0 comments on commit 9925236

Please sign in to comment.