Skip to content

Commit a524ae0

Browse files
committed
Fix alignment & healthcheck interval
Signed-off-by: Gregory May <[email protected]>
1 parent 7f543b8 commit a524ae0

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ function Handler {
4545
[FunctionContext]$fnContext,
4646
[Parameter(Mandatory=$true)]
4747
[FunctionResponse]$fnResponse
48-
)
48+
)
4949
50-
$output = "Hello! Your input was: " + $fnContext.Body
50+
$output = "Hello! Your input was: " + $fnContext.Body
5151
52-
$fnResponse.Body = $output
52+
$fnResponse.Body = $output
5353
5454
}
5555
```
@@ -63,21 +63,21 @@ function Handler {
6363
[FunctionContext]$fnContext,
6464
[Parameter(Mandatory=$true)]
6565
[FunctionResponse]$fnResponse
66-
)
66+
)
6767
68-
$json = $fnContext.Body | Out-String | ConvertFrom-Json
68+
$json = $fnContext.Body | Out-String | ConvertFrom-Json
6969
70-
$key1 = $json.key1
71-
$key2 = $json.key2
70+
$key1 = $json.key1
71+
$key2 = $json.key2
7272
73-
$output = @{
74-
"Your JSON input was" = @{
75-
key1=$key1;
76-
key2=$key2;
77-
}
78-
} | ConvertTo-Json -Compress
73+
$output = @{
74+
"Your JSON input was" = @{
75+
key1=$key1;
76+
key2=$key2;
77+
}
78+
} | ConvertTo-Json -Compress
7979
80-
$fnResponse.Body = $output
80+
$fnResponse.Body = $output
8181
8282
}
8383
```
@@ -92,19 +92,19 @@ function Handler {
9292
[FunctionContext]$fnContext,
9393
[Parameter(Mandatory=$true)]
9494
[FunctionResponse]$fnResponse
95-
)
95+
)
9696
97-
$username = $env:USERNAME
98-
$password = Get-Content "/var/openfaas/secrets/password" | ConvertTo-SecureString -AsPlainText -Force
99-
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
97+
$username = $env:USERNAME
98+
$password = Get-Content "/var/openfaas/secrets/password" | ConvertTo-SecureString -AsPlainText -Force
99+
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
100100
101-
$sessionoptions = New-PSSessionOption -SkipCACheck -SkipCNCheck
102-
$output = Invoke-Command -ComputerName <winrm-server> -Authentication Negotiate -SessionOption $sessionoptions -Credential $cred -ScriptBlock {
103-
Import-module ActiveDirectory
104-
Get-Domain
105-
}
101+
$sessionoptions = New-PSSessionOption -SkipCACheck -SkipCNCheck
102+
$output = Invoke-Command -ComputerName <winrm-server> -Authentication Negotiate -SessionOption $sessionoptions -Credential $cred -ScriptBlock {
103+
Import-module ActiveDirectory
104+
Get-Domain
105+
}
106106
107-
$fnResponse.Body = $output
107+
$fnResponse.Body = $output
108108
109109
}
110110
```

template/powershell-http/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ ENV upstream_url="http://127.0.0.1:8082"
2020

2121
EXPOSE 8080
2222

23-
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
23+
HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1
2424

2525
CMD ["fwatchdog"]

template/powershell-http/function/handler.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ function Handler {
44
[FunctionContext]$fnContext,
55
[Parameter(Mandatory=$true)]
66
[FunctionResponse]$fnResponse
7-
)
7+
)
88

9-
$output = "Hello! Your input was: " + $fnContext.Body
9+
$output = "Hello! Your input was: " + $fnContext.Body
1010

11-
$fnResponse.Body = $output
11+
$fnResponse.Body = $output
1212

1313
}

0 commit comments

Comments
 (0)