Standard Format Code Changes
This commit is contained in:
1 parent
4ce8cde5b0
commit
37028e34ad
33 files changed
+175
-232
No files matched your search
@@ -10,8 +10,6 @@ const createClone = async (clone) => {
|
||||
try {
|
||||
logger.debug('createClone %s', clone.id)
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
// Make changes to base deployment config
|
||||
deploymentManifest.metadata.name = clone.id
|
||||
|
||||
logger.debug('createClone Environment and Auth Configuration.')
|
||||
|
||||
@@ -4,31 +4,31 @@ import { Client, config } from 'kubernetes-client'
|
||||
|
||||
const getClonePodLogs = async (cloneName) => {
|
||||
try {
|
||||
logger.debug("getClonePodLogs on kubernates started.")
|
||||
logger.debug('getClonePodLogs on kubernates started.')
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
let query = {
|
||||
"qs":{
|
||||
"labelSelector": "job-name="+cloneName
|
||||
'qs': {
|
||||
'labelSelector': 'job-name=' + cloneName
|
||||
}
|
||||
}
|
||||
|
||||
const pod = await client.api.v1.namespaces('default').pods.get(query)
|
||||
|
||||
let queryLogs = {
|
||||
"qs":{
|
||||
"tailLines": "20"
|
||||
'qs': {
|
||||
'tailLines': '20'
|
||||
}
|
||||
}
|
||||
const logs = await client.api.v1.namespaces('default')
|
||||
.pods(pod.body.items[0].metadata.name).log.get(queryLogs)
|
||||
let logsArray = logs.body.split('\n')
|
||||
|
||||
logger.debug("getClonePodLogs on kubernates successful.")
|
||||
logger.debug('getClonePodLogs on kubernates successful.')
|
||||
|
||||
return JSON.stringify(logsArray, null, 2)
|
||||
} catch (err) {
|
||||
throw new KubernateError(err)
|
||||
throw new KubernateError(err)
|
||||
}
|
||||
}
|
||||
export default getClonePodLogs
|
||||
@@ -4,12 +4,12 @@ import { Client, config } from 'kubernetes-client'
|
||||
|
||||
const getClonePodStatus = async (cloneName) => {
|
||||
try {
|
||||
logger.debug("getClonePodStatus on kubernates started. ")
|
||||
logger.debug('getClonePodStatus on kubernates started. ')
|
||||
const client = new Client({config: config.fromKubeconfig(), version: '1.9'})
|
||||
|
||||
let query = {
|
||||
"qs":{
|
||||
"labelSelector": "job-name="+cloneName
|
||||
'qs': {
|
||||
'labelSelector': 'job-name=' + cloneName
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ const getClonePodStatus = async (cloneName) => {
|
||||
&& clonePodStatus.terminated.hasOwnProperty('containerID')) {
|
||||
delete clonePodStatus.terminated.containerID
|
||||
}
|
||||
logger.debug("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)
|
||||
throw new KubernateError(err)
|
||||
}
|
||||
}
|
||||
export default getClonePodStatus
|
||||
Reference in new issue
Block a user