From 163d53b1f614f0286653b8ef5d0065d2fb956cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Vesth?= Date: Fri, 10 May 2024 16:50:27 +0200 Subject: [PATCH 1/3] feat(Rancher 2): AWS-304 Add option to set max body size --- action.yml | 3 +++ src/apiService.ts | 1 + src/index.ts | 2 ++ src/types.ts | 1 + 4 files changed, 7 insertions(+) diff --git a/action.yml b/action.yml index ffab96c..c42f7e2 100644 --- a/action.yml +++ b/action.yml @@ -70,6 +70,9 @@ inputs: proxy-buffer-size: required: false description: 'Max buffer size of the nginx controller ingress (Rancher2)' + proxy-body-size: + required: false + description: "Set max body size for ingress, '0' is unlimited. Read more - https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size" readytest-initialdelay: required: false description: 'Delay in seconds before initial readiness probing' diff --git a/src/apiService.ts b/src/apiService.ts index b8eca4c..e01ab9e 100644 --- a/src/apiService.ts +++ b/src/apiService.ts @@ -89,6 +89,7 @@ export const deploy = async (authToken: string, deployment: Deployment) => { volumes: deployment.volumes, volumeMounts: deployment.volumeMounts, proxyBufferSize: deployment.proxyBufferSize, + proxyBodySize: deployment. proxyBodySize, secrets: deployment.secrets, resources: deployment.resources }, diff --git a/src/index.ts b/src/index.ts index e61a1dc..d452758 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,6 +75,7 @@ const run = async () => { const containerPortString = core.getInput("container-port"); const httpEndpoint = core.getInput("http-endpoint") || undefined; const proxyBufferSize = core.getInput("proxy-buffer-size"); + const proxyBodySize = core.getInput("proxy-body-size"); const readinessProbe = getProbeConfiguration(core, "readytest"); const livenessProbe = getProbeConfiguration(core, "healthtest"); const volumes = getVolumeConfig( @@ -119,6 +120,7 @@ const run = async () => { imageName, deployerName: deployerName, proxyBufferSize, + proxyBodySize, resources, }; console.log(JSON.stringify(deployParams)); diff --git a/src/types.ts b/src/types.ts index 3d5375c..2436462 100644 --- a/src/types.ts +++ b/src/types.ts @@ -60,6 +60,7 @@ export type Deployment = { secrets: { [name: string]: string }; deployerName: string; proxyBufferSize: string; + proxyBodySize: string; resources: Resources; }; From dd398db53c347dc80f8b0f3397205aaf51818242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Vesth?= Date: Fri, 10 May 2024 17:00:53 +0200 Subject: [PATCH 2/3] chore: only set value if exists --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index d452758..313c9d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -120,7 +120,7 @@ const run = async () => { imageName, deployerName: deployerName, proxyBufferSize, - proxyBodySize, + proxyBodySize: proxyBodySize && proxyBodySize.length > 0 ? proxyBodySize : undefined, resources, }; console.log(JSON.stringify(deployParams)); From dbd526e4fe33de43725af58a4f83d6305654aaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Lorentzen=20Vesth?= <72387849+OysteinVesth@users.noreply.github.com> Date: Fri, 10 May 2024 17:18:48 +0200 Subject: [PATCH 3/3] Update src/apiService.ts Co-authored-by: Edgar Bjorntvedt --- src/apiService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apiService.ts b/src/apiService.ts index e01ab9e..4748a35 100644 --- a/src/apiService.ts +++ b/src/apiService.ts @@ -89,7 +89,7 @@ export const deploy = async (authToken: string, deployment: Deployment) => { volumes: deployment.volumes, volumeMounts: deployment.volumeMounts, proxyBufferSize: deployment.proxyBufferSize, - proxyBodySize: deployment. proxyBodySize, + proxyBodySize: deployment.proxyBodySize, secrets: deployment.secrets, resources: deployment.resources },