Skip to content

Commit

Permalink
[env] replace APICAST_MISSING_CONFIGURATION
Browse files Browse the repository at this point in the history
by APICAST_CONFIGURATION_LOADER
  • Loading branch information
mikz committed Mar 2, 2017
1 parent 3012f35 commit 01877bc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ REDIS_HOST=redis
# Limit to subset of services. Comma separated list of service ids.
# APICAST_SERVICES=265,31,42


# What to do when Apicast does not have configuration. Allowed values are: log, exit
# APICAST_MISSING_CONFIGURATION=log

# Turn on request logging to 3scale
# APICAST_REQUEST_LOGS=1

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test-runtime-image: export IMAGE_NAME = apicast-runtime-test
test-runtime-image: clean-containers ## Smoke test the runtime image. Pass any docker image in IMAGE_NAME parameter.
$(DOCKER_COMPOSE) run --rm --user 100001 gateway apicast -d
@echo -e $(SEPARATOR)
$(DOCKER_COMPOSE) run --rm --user 100002 -e APICAST_MISSING_CONFIGURATION=exit -e THREESCALE_PORTAL_ENDPOINT=https://echo-api.3scale.net gateway bin/apicast -d
$(DOCKER_COMPOSE) run --rm --user 100002 -e APICAST_CONFIGURATION_LOADER=boot -e THREESCALE_PORTAL_ENDPOINT=https://echo-api.3scale.net gateway bin/apicast -d
@echo -e $(SEPARATOR)
$(DOCKER_COMPOSE) run --rm test sh -c 'sleep 5 && curl --fail http://gateway:8090/status/live'

Expand Down
1 change: 0 additions & 1 deletion apicast/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env REDIS_HOST;
env REDIS_PORT;
env RESOLVER;
env APICAST_MODULE;
env APICAST_MISSING_CONFIGURATION;
env APICAST_REQUEST_LOGS;
env APICAST_RESPONSE_CODES;
env APICAST_MANAGEMENT_API;
Expand Down
10 changes: 6 additions & 4 deletions doc/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ Note that when deploying APIcast v2 with OpenShift, some of thee parameters can

Specifies the log level for the OpenResty logs.

- `APICAST_MISSING_CONFIGURATION`
**Values:** log | exit
**Default:** log
- `APICAST_CONFIGURATION_LOADER`
**Values:** boot | lazy
**Default:** lazy

Used to define what APIcast should do when the configuration is missing at the initialization time. By default (_"log"_), the gateway will start successfully, and print an error message notifying of missing configuration. If set to _"exit"_, the gateway will fail to start.
Defines how to load the configuration.
Boot will require configuration when the gateway starts.
Lazy will load it on demand on incoming request.

- `APICAST_MODULE`
**Default:** "apicast"
Expand Down
10 changes: 5 additions & 5 deletions openshift/apicast-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ objects:
value: "${RESOLVER}"
- name: APICAST_SERVICES
value: "${APICAST_SERVICES}"
- name: APICAST_MISSING_CONFIGURATION
value: "${MISSING_CONFIGURATION}"
- name: APICAST_CONFIGURATION_LOADER
value: "${CONFIGURATION_LOADER}"
- name: APICAST_LOG_LEVEL
value: "${APICAST_LOG_LEVEL}"
- name: APICAST_PATH_ROUTING_ENABLED
Expand Down Expand Up @@ -130,10 +130,10 @@ parameters:
value:
name: APICAST_SERVICES
required: false
- description: "What to do on missing or invalid configuration. Allowed values are: log, exit."
value: exit
- name: CONFIGURATION_LOADER
description: "When to load configuration. If on gateway start or incoming request. Allowed values are: lazy, boot."
value: boot
required: false
name: MISSING_CONFIGURATION
- description: "Log level. One of the following: debug, info, notice, warn, error, crit, alert, or emerg."
name: APICAST_LOG_LEVEL
required: false
Expand Down

0 comments on commit 01877bc

Please sign in to comment.