Removing sensitive information from logs output
This commit is contained in:
1 parent
33cea192fa
commit
9ebec4b4e4
4 files changed
+9
-10
No files matched your search
@@ -8,7 +8,7 @@ import { BACKTEST} from '../enums/CloneMode';
|
||||
|
||||
const createClone = async (clone) => {
|
||||
try {
|
||||
logger.info("createClone %j", clone)
|
||||
logger.debug("createClone %s", clone.cloneName)
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
// Make changes to base deployment config
|
||||
@@ -127,13 +127,12 @@ const createClone = async (clone) => {
|
||||
})
|
||||
}
|
||||
|
||||
logger.debug("Configuration: %j.", env)
|
||||
deploymentManifest.spec.template.spec.containers[0].env = env
|
||||
|
||||
const create = await client.apis.batch.v1.namespaces('default').jobs.post(
|
||||
{ body: deploymentManifest })
|
||||
|
||||
logger.info("createClone %s on Kubernates success.", clone.cloneName)
|
||||
logger.debug("createClone %s on Kubernates success.", clone.cloneName)
|
||||
} catch (err) {
|
||||
throw new KubernateError(err)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Client, config } from 'kubernetes-client'
|
||||
|
||||
const getClonePodStatus = async (cloneName) => {
|
||||
try {
|
||||
logger.info("getClonePodStatus on kubernates started. ")
|
||||
logger.debug("getClonePodStatus on kubernates started. ")
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
let query = {
|
||||
@@ -12,7 +12,7 @@ const getClonePodStatus = async (cloneName) => {
|
||||
"labelSelector": "job-name="+cloneName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const pod = await client.api.v1.namespaces('default').pods.get(query)
|
||||
|
||||
let clonePodStatus = pod.body.items[0].status.containerStatuses[0].state
|
||||
@@ -21,7 +21,7 @@ const getClonePodStatus = async (cloneName) => {
|
||||
&& clonePodStatus.terminated.hasOwnProperty('containerID')) {
|
||||
delete clonePodStatus.terminated.containerID
|
||||
}
|
||||
logger.info("getClonePodStatus %s on kubernates successful", cloneName)
|
||||
logger.debug("getClonePodStatus %s on kubernates successful", cloneName)
|
||||
return JSON.stringify(clonePodStatus, null, 2)
|
||||
} catch (err) {
|
||||
throw new KubernateError(err)
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Client, config } from 'kubernetes-client'
|
||||
|
||||
const removeClone = async (clone) => {
|
||||
try {
|
||||
logger.info("removeClone %s", clone.cloneName)
|
||||
logger.debug("removeClone %s", clone.cloneName)
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
let query = {
|
||||
@@ -20,7 +20,7 @@ const removeClone = async (clone) => {
|
||||
const podRemoved = await client.api.v1.namespaces('default')
|
||||
.pods(pod.body.items[0].metadata.name).delete()
|
||||
|
||||
logger.info("removeClone %s on kubernates succesful", clone.cloneName)
|
||||
logger.debug("removeClone %s on kubernates succesful", clone.cloneName)
|
||||
} catch (err) {
|
||||
throw new KubernateError(err)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const resolve = async(parent, { clone }, context) => {
|
||||
active: true
|
||||
})
|
||||
|
||||
logger.debug('addClone -> Checking existing clone %j', existingClone)
|
||||
logger.debug('addClone -> Checking existing clone.')
|
||||
if(existingClone.length > 0){
|
||||
throw new OperationsError('You can only have one active clone by mode. Remove the'
|
||||
+ ' existing clone of type: ' + clone.mode + ' and try again.')
|
||||
@@ -66,7 +66,7 @@ const resolve = async(parent, { clone }, context) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
newClone.save((err) => {
|
||||
if (err){
|
||||
logger.debug('addClone -> Error: %j', err)
|
||||
logger.error('addClone -> Error: %s', err.stack)
|
||||
reject('There has been an error storing the clone.')
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in new issue
Block a user