Skip to content

Commit

Permalink
fixes service account config / logger.level => log.level
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed May 31, 2018
1 parent 3c7c0c9 commit c659974
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ List of configurable values:

|Setting|Description|Environment Variable| Default Value|
|-------|-----------|--------------------|--------------|
|`logger.level`|Loglevel for winston logger|`LOG_LEVEL`|`debug`|
|`log.level`|Loglevel for winston logger|`LOG_LEVEL`|`info`|
|`icinga.address`|Icinga2 address|`ICINGA_ADDRESS`|`127.0.01`|
|`icinga.port`|Icinga2 API port|`ICINGA_PORT`|`5665`|
|`icinga.apiUser`|Icinga2 API username|`ICINGA_API_USERNAME`|`admin`|
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"logger": {
"log": {
"level": "info"
},
"cleanup": true,
Expand Down
14 changes: 13 additions & 1 deletion kube-icinga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ metadata:
labels:
k8s-app: kube-icinga
rules:
- apiGroups: [""] # "" indicates the core API group
- apiGroups:
- ""
- extensions
resources:
- namespaces
- ingresses
Expand All @@ -38,6 +40,16 @@ rules:
- get
- watch
- list
- apiGroups:
- extensions
- ""
resources:
- ingresses
- ingresses/status
verbs:
- get
- watch
- list
---
apiVersion: v1
kind: ServiceAccount
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ try {
}

const config = {
logger: {
level: process.env.LOGGER_LEVEL || defaultConfig.logger.level || 'info',
log: {
level: process.env.LOG_LEVEL || defaultConfig.log.level || 'info',
},
cleanup: process.env.CLEANUP || defaultConfig.cleanup || true,
icinga: {
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as winston from 'winston';
import config from './config';

const logger = winston.createLogger({
level: config.logger.level,
level: config.log.level,
format: winston.format.simple(),
transports: [
new winston.transports.Console(),
Expand Down

0 comments on commit c659974

Please sign in to comment.