Skip to content

Commit

Permalink
Merge pull request #6 from gyselroth/dev
Browse files Browse the repository at this point in the history
readme fix, lint run
  • Loading branch information
raffis committed Feb 21, 2019
2 parents 9136830 + feeaa06 commit 4b8d78c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Multiple watchers are bootstraped and listen for any kubernetes changes. Those c
* Kubernetes namespaces will result in icinga service groups
* Nodes will result in host objects
* Ingresses will result in icinga services (and or host objects)
* Services (ClusterIP, NodePort [2], LoadBalanacer) will result in icinga services (and/or host objects)
* Services (ClusterIP, NodePort, LoadBalanacer) will result in icinga services (and/or host objects)
* Persistent volumes will result in icinga services (and/or host objects)

## Table of Contents
Expand Down
12 changes: 6 additions & 6 deletions src/icinga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export default class Icinga {
*/
protected checkRestart(): void {
setInterval(() => {
this.logger.debug(`check if icinga service restart is required (https://github.com/Icinga/icinga2/issues/6012)`);
if(this.triggerRestart === true) {
this.logger.debug(`icinga service restart required`);
this.logger.debug('check if icinga service restart is required (https://github.com/Icinga/icinga2/issues/6012)');
if (this.triggerRestart === true) {
this.logger.debug('icinga service restart required');
this.triggerRestart = false;

this.icingaClient.restartProcess((err, result) => {
if(err) {
this.logger.error(`trigger icinga service restart`, {error: err});
if (err) {
this.logger.error('trigger icinga service restart', {error: err});
} else {
this.logger.info(`icinga service restart triggered`);
this.logger.info('icinga service restart triggered');
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/kube/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ export default class Service extends Resource {
let hasCommand = await this.icinga.hasCheckCommand(port.check_command);
if (hasCommand) {
this.logger.debug('service can be checked via check command '+port.check_command);

if (serviceType !== Service.TYPE_NODEPORT) {
port['vars.'+port.check_command+'_address'] = definition.spec.clusterIP;
}
}

port['vars.'+port.check_command+'_port'] = servicePort.nodePort || servicePort.port;
} else {
delete port.check_command;
Expand All @@ -162,7 +162,7 @@ export default class Service extends Resource {
if (serviceType !== Service.TYPE_NODEPORT) {
port['vars.'+protocol+'_address'] = definition.spec.clusterIP;
}

port['vars.'+protocol+'_port'] = servicePort.nodePort || servicePort.port;
}

Expand Down
2 changes: 1 addition & 1 deletion src/kube/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class Volume extends Resource {

if (this.options.applyServices) {
let groups = [];

if (definition.spec.claimRef.namespace) {
groups.push(definition.spec.claimRef.namespace);
await this.icinga.applyServiceGroup(definition.spec.claimRef.namespace);
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function main() {
logger.error('failed to cleanup icinga hosts', {error: err});
});
}

if (config.kubernetes.nodes.discover) {
kubeNode.kubeListener(function() {
let json = new JSONStream();
Expand Down

0 comments on commit 4b8d78c

Please sign in to comment.