Merge pull request #9170 from dokku/fix-pre-existing-lint-issues
chore: fix pre-existing gofmt and markdown lint issues
This commit is contained in:
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
||||
- name: Install markdownlint-cli
|
||||
run: npm install -g markdownlint-cli@0.35.0
|
||||
- name: Run markdown-lint
|
||||
run: markdownlint -c .github/linters/.markdown-lint.yml *.md **/*.md
|
||||
run: markdownlint -c .github/linters/.markdown-lint.yml --ignore tests/apps '**/*.md'
|
||||
|
||||
packer:
|
||||
name: packer
|
||||
|
||||
@@ -67,7 +67,7 @@ Sometimes it may be desirable to set a different path for a given app, e.g. when
|
||||
dokku app-json:set node-js-app appjson-path .dokku/app.json
|
||||
```
|
||||
|
||||
The value is the path to the desired file *relative* to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `app.json`.
|
||||
The value is the path to the desired file _relative_ to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `app.json`.
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ dokku registry:set --global push-on-release
|
||||
|
||||
When `push-on-release` is enabled, Dokku treats the remote registry as the canonical store for app images. If a local image disappears - for example because a `docker image prune` cron ran, the host rebooted, or an operator removed it manually - subsequent commands that need the image (`ps:restart`, `ps:scale`, `dokku run`, `domains:add`, `certs:add`, etc.) will pull the missing tag back from the registry automatically. Per-app registry credentials configured via `registry:login` are honored during the pull. This recovery covers the deployed numeric tag pushed by the registry plugin - a missing `latest` tag will be ignored.
|
||||
|
||||
### Push extra tags
|
||||
### Push extra tags
|
||||
|
||||
To push the image on release with extra tags, set the `push-extra-tags` to a comma-separated list of tags via the `registry:set` command. The default value for this property is empty. Setting the property will result in the image being tagged with extra tags every release.
|
||||
|
||||
@@ -251,6 +251,7 @@ To push the image on release with extra tags, set the `push-extra-tags` to a com
|
||||
# multiple-tags
|
||||
dokku registry:set node-js-app push-extra-tags foo,bar
|
||||
```
|
||||
|
||||
The `push-extra-tags` can be set to a single tag too.
|
||||
|
||||
```shell
|
||||
|
||||
@@ -6,11 +6,14 @@
|
||||
- The default image used for Cloud Native Buildpack builds is now `heroku/builder:24`, and is based on both the `heroku-24` stack as well as Ubuntu 24.04. Users that wish to stick with the old, `heroku-22`/Ubuntu 22.04 builder may specify `heroku/buildpacks:22` as their builder image. Please see the [cloud native buildpack deployment documentation](/docs/deployment/builders/cloud-native-buildpacks.md#customizing-the-buildpack-stack-builder) for more information on how to specify a custom buildpack stack builder.
|
||||
- The default image used for Herokuish Buildpack builds is now `gliderlabs/herokuish:latest-24`, and is based on both the `heroku-24` stack as well as Ubuntu 24.04. Users that wish to stick with the old, `heroku-22`/Ubuntu 22.04 builder may specify `gliderlabs/herokuish:latest-22` as their builder image. Please see the [herokuish buildpack deployment documentation](/docs/deployment/builders/herokuish-buildpacks.md#customizing-the-buildpack-stack-builder) for more information on how to specify a custom buildpack stack builder.
|
||||
- The `vector` image used by Dokku for enhanced logging support has been upgraded from 0.39.x to 0.41.x. To take advantage of the new image, execute the following commands:
|
||||
|
||||
```
|
||||
dokku logs:vector-stop
|
||||
dokku logs:vector-start
|
||||
```
|
||||
|
||||
- The `openresty` image used by Dokku for proxying via openresty has been upgraded from 0.8.0 to 0.9.0. To take advantage of the new image, execute the following commands:
|
||||
|
||||
```
|
||||
dokku openresty:stop
|
||||
dokku openresty:start
|
||||
|
||||
@@ -90,6 +90,7 @@ Environment variables from `app.json` are processed during the first deploy, bef
|
||||
4. **Optional variables without a value**: Skipped silently if no TTY is available
|
||||
|
||||
On subsequent deploys:
|
||||
|
||||
- Variables are NOT re-set unless `sync: true` is specified
|
||||
- Variables with `sync: true` are always set to their configured value, overwriting any manual changes
|
||||
- Variables that already have values are not modified
|
||||
@@ -97,6 +98,7 @@ On subsequent deploys:
|
||||
### Examples
|
||||
|
||||
**Simple default value:**
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
@@ -106,6 +108,7 @@ On subsequent deploys:
|
||||
```
|
||||
|
||||
**Generated secret (recommended for API keys, tokens, etc.):**
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
@@ -118,6 +121,7 @@ On subsequent deploys:
|
||||
```
|
||||
|
||||
**Required variable that must be provided:**
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
@@ -130,6 +134,7 @@ On subsequent deploys:
|
||||
```
|
||||
|
||||
**Variable that stays in sync with app.json:**
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
|
||||
@@ -268,7 +268,6 @@ The following plugins are no longer maintained by their developers.
|
||||
[calyhre]: https://github.com/calyhre
|
||||
[cameron-martin]: https://github.com/cameron-martin
|
||||
[candlewaster]: https://notabug.org/candlewaster
|
||||
[cedricziel]: https://github.com/cedricziel
|
||||
[cef]: https://github.com/cef
|
||||
[cheif]: https://github.com/cheif
|
||||
[cjblomqvist]: https://github.com/cjblomqvist
|
||||
|
||||
@@ -207,7 +207,6 @@ See the [buildpack management documentation](/docs/deployment/builders/buildpack
|
||||
|
||||
See the [buildpack management documentation](/docs/deployment/builders/buildpack-management.md#using-a-specific-buildpack-version) for more information on how to using a specific buildpack version
|
||||
|
||||
|
||||
### Displaying buildpack reports for an app
|
||||
|
||||
See the [buildpack management documentation](/docs/deployment/builders/buildpack-management.md#displaying-buildpack-reports-for-an-app) for more information on how to display buildpack reports for an app.
|
||||
@@ -218,4 +217,4 @@ See the [buildpack management documentation](/docs/deployment/builders/buildpack
|
||||
|
||||
| Property | Scope | Default | Report flags | Description |
|
||||
|---|---|---|---|---|
|
||||
| `allowed` | app + global | `true` | `--builder-herokuish-allowed`, `--builder-herokuish-global-allowed`, `--builder-herokuish-computed-allowed` | When `false`, the herokuish builder is skipped during builder detection for this app |
|
||||
| `allowed` | app + global | `true` | `--builder-herokuish-allowed`, `--builder-herokuish-global-allowed`, `--builder-herokuish-computed-allowed` | When `false`, the herokuish builder is skipped during builder detection for this app |
|
||||
|
||||
@@ -13,14 +13,17 @@ Before using Railpacks, the following steps must be taken:
|
||||
|
||||
- Install the `railpack` cli: The `railpack` cli tool is not included by default with Dokku or as a dependency. It must also be installed as shown on [this page](https://railpack.com/installation).
|
||||
- Create a `buildkit` builder: Railpack uses buildkit.
|
||||
```shell
|
||||
docker run --rm --privileged -d --name buildkit moby/buildkit
|
||||
```
|
||||
|
||||
```shell
|
||||
docker run --rm --privileged -d --name buildkit moby/buildkit
|
||||
```
|
||||
|
||||
- Set the buildkit builder: Update the `/etc/default/dokku` file to set `BUILDKIT_HOST`:
|
||||
```shell
|
||||
touch /etc/default/dokku
|
||||
echo "export BUILDKIT_HOST='docker-container://buildkit'" >> /etc/default/dokku
|
||||
```
|
||||
|
||||
```shell
|
||||
touch /etc/default/dokku
|
||||
echo "export BUILDKIT_HOST='docker-container://buildkit'" >> /etc/default/dokku
|
||||
```
|
||||
|
||||
### Detection
|
||||
|
||||
|
||||
@@ -26,4 +26,4 @@ steps:
|
||||
```
|
||||
|
||||
- The standard `clone` stage is replaced with one that performs a complete clone of the repository (the default is a shallow clone, which dokku would reject).
|
||||
- A `GIT_REMOTE_URL` and a `SSH_PRIVATE_KEY` (with help of the `from_secret` directive) suffice to carry out a deployment.
|
||||
- A `GIT_REMOTE_URL` and a `SSH_PRIVATE_KEY` (with help of the `from_secret` directive) suffice to carry out a deployment.
|
||||
|
||||
@@ -957,7 +957,7 @@ dokku docker-options:add node-js-app deploy "--sysctl net.ipv4.ip_unprivileged_p
|
||||
|
||||
Passing a non-namespaced sysctl this way fails the deploy rather than silently dropping the value, since it provably cannot take effect within a pod. Note this differs from the `docker-local` scheduler, where such an option is passed straight through to `docker run`.
|
||||
|
||||
Kubernetes further splits namespaced sysctls into a *safe* list that any pod may set, and everything else. A sysctl outside the safe list - `net.core.somaxconn`, for example - is rejected at pod admission unless the node's kubelet was started with a matching `allowed-unsafe-sysctls` value, which can be supplied at cluster initialization or when joining a node.
|
||||
Kubernetes further splits namespaced sysctls into a _safe_ list that any pod may set, and everything else. A sysctl outside the safe list - `net.core.somaxconn`, for example - is rejected at pod admission unless the node's kubelet was started with a matching `allowed-unsafe-sysctls` value, which can be supplied at cluster initialization or when joining a node.
|
||||
|
||||
```shell
|
||||
dokku scheduler-k3s:initialize --kubelet-args allowed-unsafe-sysctls=net.core.somaxconn
|
||||
|
||||
@@ -97,6 +97,7 @@ free
|
||||
|
||||
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
|
||||
```
|
||||
|
||||
Note: it may be necessary to call swapoff, mkswap and swapon explicitly: `sudo /sbin/swapoff /var/swap.img`, etc.
|
||||
|
||||
[Reference](https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps)
|
||||
|
||||
@@ -226,22 +226,20 @@ sudo ufw disable
|
||||
|
||||
### I can't connect to my application because the server is sending an invalid response, or can't provide a secure connection
|
||||
|
||||
This is normally a config problem with your app, rather than an issue with Dokku.
|
||||
This is normally a config problem with your app, rather than an issue with Dokku.
|
||||
|
||||
One common cause is an application configured to enforce secure connections/HSTS, but SSL is not set up. In Ruby on Rails, if your `application.rb` or `config/environments/production.rb` include the line `configure.force_ssl = true`, try commenting that line out and redeploying. If this solves the issue temporarily, longer-term you should consider [configuring SSL](/docs/configuration/ssl.md).
|
||||
|
||||
|
||||
### I deployed a new application, but an existing application is being served when I visit it
|
||||
|
||||
This problem has the same cause as the previous issue: your application is attempting to enforce SSL, but SSL is not configured. Disabling SSL enforcement should solve the problem.
|
||||
|
||||
The underlying cause is best understood with an example. Let's say you already have `https://apples.example.com/` working, and you're trying to deploy `bananas.example.com/`. But whenever you visit `bananas.example.com` you see `apples.example.com` instead. This is caused by `bananas.example.com` forcing SSL:
|
||||
The underlying cause is best understood with an example. Let's say you already have `https://apples.example.com/` working, and you're trying to deploy `bananas.example.com/`. But whenever you visit `bananas.example.com` you see `apples.example.com` instead. This is caused by `bananas.example.com` forcing SSL:
|
||||
|
||||
1. Your browser sends a request to `http://bananas.example.com`.
|
||||
1. `bananas.example.com` issues a redirect to `https://bananas.example.com`.
|
||||
1. Your browser sends a request to `https://bananas.example.com`. But you haven't configured SSL for `bananas.example.com` yet! So this request ends up routed to `https://apples.example.com`, which _does_ have an SSL config.
|
||||
|
||||
|
||||
### My application deploys properly, but won't load in browser "connection refused"
|
||||
|
||||
This could be a result of a bad proxy configuration (`http:5000:5000` may be incorrect). Run `dokku ports:report node-js-app` to check if your app has the correct proxy configuration. It should show something like the following.
|
||||
|
||||
@@ -241,22 +241,22 @@ By default, Traefik uses TLS-ALPN-01 challenge for obtaining certificates. To sw
|
||||
|
||||
1. Set the challenge mode to `dns`:
|
||||
|
||||
```shell
|
||||
dokku traefik:set --global challenge-mode dns
|
||||
```
|
||||
```shell
|
||||
dokku traefik:set --global challenge-mode dns
|
||||
```
|
||||
|
||||
2. Set your DNS provider:
|
||||
|
||||
```shell
|
||||
dokku traefik:set --global dns-provider cloudflare
|
||||
```
|
||||
```shell
|
||||
dokku traefik:set --global dns-provider cloudflare
|
||||
```
|
||||
|
||||
3. Configure the required environment variables for your DNS provider. Each DNS provider requires specific environment variables. The variable names should be prefixed with `dns-provider-`:
|
||||
|
||||
```shell
|
||||
dokku traefik:set --global dns-provider-cf_api_email user@example.com
|
||||
dokku traefik:set --global dns-provider-cf_api_key your-api-key
|
||||
```
|
||||
```shell
|
||||
dokku traefik:set --global dns-provider-cf_api_email user@example.com
|
||||
dokku traefik:set --global dns-provider-cf_api_key your-api-key
|
||||
```
|
||||
|
||||
The `dns-provider-` prefix will be stripped and the variable name will be uppercased when passed to the Traefik container. For example, `dns-provider-cf_api_email` becomes `CF_API_EMAIL`.
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ One off containers are removed at the end of process execution.
|
||||
|
||||
In addition, one-off containers also run for a max of 24 hours (86400 seconds) by default, after which they are reaped. This can be changed by setting the `--ttl-seconds` argument:
|
||||
|
||||
|
||||
```shell
|
||||
# runs for 10 minutes
|
||||
dokku run --ttl-seconds 600 node-js-app npm run mytask
|
||||
|
||||
@@ -127,7 +127,7 @@ The `ps` plugin provides a number of settings that can be used to managed deploy
|
||||
|
||||
| Name | Description | Global Default |
|
||||
|-----------------------|---------------------------------------------------|--------------------|
|
||||
| `stop-timeout` | Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands *also* respect this value. If not specified, the Docker defaults for the [`docker stop` command](https://docs.docker.com/engine/reference/commandline/stop/) will be used. | `30` |
|
||||
| `stop-timeout` | Configurable grace period given to the `docker stop` command. If a container has not stopped by this time, a `kill -9` signal or equivalent is sent in order to force-terminate the container. Both the `ps:stop` and `apps:destroy` commands _also_ respect this value. If not specified, the Docker defaults for the [`docker stop` command](https://docs.docker.com/engine/reference/commandline/stop/) will be used. | `30` |
|
||||
|
||||
All settings can be set via the `ps:set` command. Using `stop-timeout` as an example:
|
||||
|
||||
@@ -216,7 +216,7 @@ Sometimes it may be desirable to set a different path for a given app, e.g. when
|
||||
dokku ps:set node-js-app procfile-path .dokku/Procfile
|
||||
```
|
||||
|
||||
The value is the path to the desired file *relative* to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `Procfile`.
|
||||
The value is the path to the desired file _relative_ to the base search directory, and will never be treated as absolute paths in any context. If that file does not exist within the repository, Dokku will continue the build process as if the repository has no `Procfile`.
|
||||
|
||||
The default value may be set by passing an empty value for the option:
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ A cron task takes the following properties:
|
||||
- `schedule`: A [cron-compatible](https://en.wikipedia.org/wiki/Cron#Overview) scheduling definition upon which to run the command. Seconds are generally not supported.
|
||||
- `concurrency_policy`: A string (default: `allow`), that controls whether the cron task can be run concurrently with another invocation of itself. Valid options are `allow` (allow concurrency), `forbid` (exit the new cron task if there is an existing one), `replace` (delete any existing cron task and start the new one).
|
||||
|
||||
|
||||
Zero or more cron tasks can be specified per app. Cron tasks are validated after the build artifact is created but before the app is deployed, and the cron schedule is updated during the post-deploy phase.
|
||||
|
||||
Cron tasks can run for a maximum of 24 hours, after which they are reaped from the system. The `docker-local` scheduler reaps expired tasks via the `dokku ps:retire` pass that runs every 5 minutes, so a task may overrun its deadline by up to 5 minutes. The `k3s` scheduler enforces the deadline directly through the job's `activeDeadlineSeconds`.
|
||||
|
||||
@@ -15,10 +15,10 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
var flags map[string]common.ReportFunc
|
||||
if appName == "--global" {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--builder-global-selected": reportGlobalSelected,
|
||||
"--builder-global-build-dir": reportGlobalBuildDir,
|
||||
"--builder-global-skip-cleanup": reportGlobalSkipCleanup,
|
||||
"--builder-computed-skip-cleanup": reportComputedSkipCleanup,
|
||||
"--builder-global-selected": reportGlobalSelected,
|
||||
"--builder-global-build-dir": reportGlobalBuildDir,
|
||||
"--builder-global-skip-cleanup": reportGlobalSkipCleanup,
|
||||
"--builder-computed-skip-cleanup": reportComputedSkipCleanup,
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
|
||||
@@ -36,7 +36,7 @@ func main() {
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
if *branch == "" {
|
||||
*branch = common.PropertyGet("git", appName, "deploy-branch")
|
||||
*branch = common.PropertyGet("git", appName, "deploy-branch")
|
||||
}
|
||||
err = buildpacks.CommandDetect(appName, *branch)
|
||||
case "list":
|
||||
|
||||
@@ -39,9 +39,9 @@ func CommandDetect(appName string, branch string) (err error) {
|
||||
|
||||
workDir := common.AppRoot(appName)
|
||||
checkedOutDir, err := checkoutBareGitRepo(workDir, branch)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err := os.RemoveAll(checkedOutDir); err != nil {
|
||||
common.LogWarn(fmt.Sprintf("Failed to remove temporary directory %s: %v", checkedOutDir, err))
|
||||
|
||||
@@ -208,8 +208,8 @@ func TestReportSingleAppJSONNonPluginPrefixKey(t *testing.T) {
|
||||
// Keys that don't start with --<reportType>- should pass through with
|
||||
// only the leading "--" stripped, regardless of TrimPrefix.
|
||||
infoFlags := map[string]string{
|
||||
"--build-id": "abc123",
|
||||
"--builds-retention": "5",
|
||||
"--build-id": "abc123",
|
||||
"--builds-retention": "5",
|
||||
}
|
||||
|
||||
out := captureStdout(t, func() {
|
||||
|
||||
@@ -154,9 +154,12 @@ func joinShellTokens(tokens []string) string {
|
||||
// quoteShellArg returns s wrapped in single quotes when it contains characters
|
||||
// the shell would otherwise interpret (whitespace, quotes, expansion sigils,
|
||||
// globs, redirections, etc.). Embedded single quotes are escaped with the
|
||||
// standard `'\''` close-escape-open sequence. Tokens free of such characters
|
||||
// are returned verbatim so the stored representation stays human-readable for
|
||||
// the common case.
|
||||
// standard close-escape-open sequence:
|
||||
//
|
||||
// '\''
|
||||
//
|
||||
// Tokens free of such characters are returned verbatim so the stored
|
||||
// representation stays human-readable for the common case.
|
||||
func quoteShellArg(s string) string {
|
||||
if s == "" {
|
||||
return "''"
|
||||
|
||||
@@ -22,43 +22,43 @@ func templatePath(t *testing.T) string {
|
||||
|
||||
func defaultVars() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"APP": "app",
|
||||
"DOKKU_ROOT": "/home/dokku",
|
||||
"DOKKU_LIB_ROOT": "/var/lib/dokku",
|
||||
"NOSSL_SERVER_NAME": "app.example.com",
|
||||
"SSL_SERVER_NAME": "",
|
||||
"SSL_INUSE": "",
|
||||
"APP_SSL_PATH": "/home/dokku/app/tls",
|
||||
"DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000",
|
||||
"PROXY_PORT_MAP": "http:80:5000",
|
||||
"PROXY_UPSTREAM_PORTS": "5000",
|
||||
"PROXY_PORT": "80",
|
||||
"PROXY_SSL_PORT": "443",
|
||||
"PROXY_KEEPALIVE": "",
|
||||
"NGINX_BIND_ADDRESS_IP4": "",
|
||||
"NGINX_BIND_ADDRESS_IP6": "::",
|
||||
"NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log",
|
||||
"NGINX_ACCESS_LOG_FORMAT": "",
|
||||
"NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log",
|
||||
"NGINX_UNDERSCORE_IN_HEADERS": "off",
|
||||
"CLIENT_BODY_TIMEOUT": "60s",
|
||||
"CLIENT_HEADER_TIMEOUT": "60s",
|
||||
"CLIENT_MAX_BODY_SIZE": "1m",
|
||||
"KEEPALIVE_TIMEOUT": "75s",
|
||||
"LINGERING_TIMEOUT": "5s",
|
||||
"SEND_TIMEOUT": "60s",
|
||||
"PROXY_CONNECT_TIMEOUT": "60s",
|
||||
"PROXY_READ_TIMEOUT": "60s",
|
||||
"PROXY_SEND_TIMEOUT": "60s",
|
||||
"PROXY_BUFFER_SIZE": "4k",
|
||||
"PROXY_BUFFERING": "on",
|
||||
"PROXY_BUFFERS": "8 4k",
|
||||
"PROXY_BUSY_BUFFERS_SIZE": "8k",
|
||||
"PROXY_X_FORWARDED_FOR": "$remote_addr",
|
||||
"PROXY_X_FORWARDED_PORT": "$server_port",
|
||||
"PROXY_X_FORWARDED_PROTO": "$scheme",
|
||||
"PROXY_X_FORWARDED_SSL": "",
|
||||
"HTTP2_DIRECTIVE_SUPPORTED": "true",
|
||||
"APP": "app",
|
||||
"DOKKU_ROOT": "/home/dokku",
|
||||
"DOKKU_LIB_ROOT": "/var/lib/dokku",
|
||||
"NOSSL_SERVER_NAME": "app.example.com",
|
||||
"SSL_SERVER_NAME": "",
|
||||
"SSL_INUSE": "",
|
||||
"APP_SSL_PATH": "/home/dokku/app/tls",
|
||||
"DOKKU_APP_WEB_LISTENERS": "127.0.0.1:5000",
|
||||
"PROXY_PORT_MAP": "http:80:5000",
|
||||
"PROXY_UPSTREAM_PORTS": "5000",
|
||||
"PROXY_PORT": "80",
|
||||
"PROXY_SSL_PORT": "443",
|
||||
"PROXY_KEEPALIVE": "",
|
||||
"NGINX_BIND_ADDRESS_IP4": "",
|
||||
"NGINX_BIND_ADDRESS_IP6": "::",
|
||||
"NGINX_ACCESS_LOG_PATH": "/var/log/nginx/app-access.log",
|
||||
"NGINX_ACCESS_LOG_FORMAT": "",
|
||||
"NGINX_ERROR_LOG_PATH": "/var/log/nginx/app-error.log",
|
||||
"NGINX_UNDERSCORE_IN_HEADERS": "off",
|
||||
"CLIENT_BODY_TIMEOUT": "60s",
|
||||
"CLIENT_HEADER_TIMEOUT": "60s",
|
||||
"CLIENT_MAX_BODY_SIZE": "1m",
|
||||
"KEEPALIVE_TIMEOUT": "75s",
|
||||
"LINGERING_TIMEOUT": "5s",
|
||||
"SEND_TIMEOUT": "60s",
|
||||
"PROXY_CONNECT_TIMEOUT": "60s",
|
||||
"PROXY_READ_TIMEOUT": "60s",
|
||||
"PROXY_SEND_TIMEOUT": "60s",
|
||||
"PROXY_BUFFER_SIZE": "4k",
|
||||
"PROXY_BUFFERING": "on",
|
||||
"PROXY_BUFFERS": "8 4k",
|
||||
"PROXY_BUSY_BUFFERS_SIZE": "8k",
|
||||
"PROXY_X_FORWARDED_FOR": "$remote_addr",
|
||||
"PROXY_X_FORWARDED_PORT": "$server_port",
|
||||
"PROXY_X_FORWARDED_PROTO": "$scheme",
|
||||
"PROXY_X_FORWARDED_SSL": "",
|
||||
"HTTP2_DIRECTIVE_SUPPORTED": "true",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,8 +266,8 @@ func TestTemplate_XForwardedSSL(t *testing.T) {
|
||||
|
||||
func TestTemplate_NginxConfDIncludeAlways(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
mutate func(map[string]interface{})
|
||||
name string
|
||||
mutate func(map[string]interface{})
|
||||
}{
|
||||
{"http", func(v map[string]interface{}) {}},
|
||||
{"http_redirect", func(v map[string]interface{}) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
|
||||
// PortMap is a struct that contains a scheme:host-port:container-port mapping
|
||||
type PortMap struct {
|
||||
// ContainerPort is the port on the container
|
||||
|
||||
@@ -30,27 +30,27 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--deployed": reportDeployed,
|
||||
"--processes": reportProcesses,
|
||||
"--ps-can-scale": reportCanScale,
|
||||
"--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd,
|
||||
"--ps-computed-procfile-path": reportComputedProcfilePath,
|
||||
"--ps-computed-restart-policy": reportComputedRestartPolicy,
|
||||
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
|
||||
"--ps-computed-start-cmd": reportComputedStartCmd,
|
||||
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
|
||||
"--ps-dockerfile-start-cmd": reportDockerfileStartCmd,
|
||||
"--ps-global-procfile-path": reportGlobalProcfilePath,
|
||||
"--ps-global-restart-policy": reportGlobalRestartPolicy,
|
||||
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
|
||||
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
|
||||
"--ps-procfile-path": reportProcfilePath,
|
||||
"--ps-restart-policy": reportRestartPolicy,
|
||||
"--ps-skip-deploy": reportSkipDeploy,
|
||||
"--ps-start-cmd": reportStartCmd,
|
||||
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
|
||||
"--restore": reportRestore,
|
||||
"--running": reportRunningState,
|
||||
"--deployed": reportDeployed,
|
||||
"--processes": reportProcesses,
|
||||
"--ps-can-scale": reportCanScale,
|
||||
"--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd,
|
||||
"--ps-computed-procfile-path": reportComputedProcfilePath,
|
||||
"--ps-computed-restart-policy": reportComputedRestartPolicy,
|
||||
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
|
||||
"--ps-computed-start-cmd": reportComputedStartCmd,
|
||||
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
|
||||
"--ps-dockerfile-start-cmd": reportDockerfileStartCmd,
|
||||
"--ps-global-procfile-path": reportGlobalProcfilePath,
|
||||
"--ps-global-restart-policy": reportGlobalRestartPolicy,
|
||||
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
|
||||
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
|
||||
"--ps-procfile-path": reportProcfilePath,
|
||||
"--ps-restart-policy": reportRestartPolicy,
|
||||
"--ps-skip-deploy": reportSkipDeploy,
|
||||
"--ps-start-cmd": reportStartCmd,
|
||||
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
|
||||
"--restore": reportRestore,
|
||||
"--running": reportRunningState,
|
||||
}
|
||||
|
||||
extraFlags := addStatusFlags(appName, infoFlag)
|
||||
|
||||
@@ -41,11 +41,11 @@ func TestGetLowestNodeVersion(t *testing.T) {
|
||||
}
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
nodes []*corev1.Node
|
||||
selector string
|
||||
want string
|
||||
wantErr string
|
||||
name string
|
||||
nodes []*corev1.Node
|
||||
selector string
|
||||
want string
|
||||
wantErr string
|
||||
}{
|
||||
{
|
||||
name: "single control-plane node returns its kubelet version",
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t
|
||||
setupChartMigrationTest(t)
|
||||
|
||||
Expect(common.PropertyMapWrite("scheduler-k3s", "--global", "chart-overrides.cert-manager", map[string]string{
|
||||
"installCRDs": "true",
|
||||
"installCRDs": "true",
|
||||
"service.annotations.prometheus.io/scrape": "true",
|
||||
})).To(Succeed())
|
||||
Expect(common.PropertyWrite("scheduler-k3s", "--global", "chart.cert-manager.installCRDs", "false")).To(Succeed())
|
||||
@@ -99,9 +99,9 @@ func TestMigrateChartPropertiesToMapFormatPreservesExistingNonOverlappingKeys(t
|
||||
got, err := common.PropertyMapGet("scheduler-k3s", "--global", "chart-overrides.cert-manager")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(got).To(Equal(map[string]string{
|
||||
"installCRDs": "false",
|
||||
"installCRDs": "false",
|
||||
"service.annotations.prometheus.io/scrape": "true",
|
||||
"version": "1.13.3",
|
||||
"version": "1.13.3",
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user