Merge pull request #29 from Superalgos/develop

Fixing name issue
This commit is contained in:
z@tOr authored and GitHub committed 2019-02-11 19:57:33 -03:00
commit 12ea5485bb
4 files changed
+4 -5

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ const createClone = async (clone) => {
const create = await client.apis.batch.v1.namespaces('default').jobs.post(
{ body: deploymentManifest })
logger.debug("createClone %s on Kubernates success.", clone.cloneName)
logger.debug("createClone %s on Kubernates success.", clone.id)
} catch (err) {
throw new KubernateError(err)
}
+2 -2
View File
@@ -14,13 +14,13 @@ const removeClone = async (clone) => {
}
const removed = await client.apis.batch.v1.namespaces('default').jobs(
clone.cloneName).delete()
clone.id).delete()
const pod = await client.api.v1.namespaces('default').pods.get(query)
const podRemoved = await client.api.v1.namespaces('default')
.pods(pod.body.items[0].metadata.name).delete()
logger.debug("removeClone %s on kubernates succesful", clone.cloneName)
logger.debug("removeClone %s on kubernates succesful", clone.id)
} catch (err) {
throw new KubernateError(err)
}
+1 -1
View File
@@ -5,7 +5,7 @@ import { AutorizationError } from '../errors'
const cloneDetails = async(authId, team, clone) => {
logger.debug('Retrieving clone details.')
if(!(authId === process.env.AACLOUD_ID || isAuthorized(team, authId))){
if(!(authId === (process.env.AUTH_CLIENT_ID + '@clients') || isAuthorized(team, authId))){
logger.debug('User %s is not authorized to manage team %s.', authId, team.slug )
throw new AutorizationError()
}
-1
View File
@@ -30,7 +30,6 @@ const resolve = async(parent, args, context) => {
}).sort({createDatetime: -1})
for (var i = 0; i < clones.length; i++) {
logger.debug('List Clones -> clone: %j',clones[i] )
let team = await teamQuery(context.authorization, clones[i].teamId)
clones[i] = await cloneDetails(context.userId, team.data.data.teams_TeamById, clones[i])
let state = await getCloneStatus(clones[i].id)