mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-16 03:22:18 +08:00
review comments changes
This commit is contained in:
parent
ef8defce31
commit
52883f3264
@ -177,7 +177,7 @@ function getFilePathsConfigs() {
|
|||||||
if (res.stderr != '' && !res.success) {
|
if (res.stderr != '' && !res.success) {
|
||||||
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)[0]}`);
|
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)[0]}`);
|
||||||
}
|
}
|
||||||
if (!res.stdout) {
|
if (res.stdout) {
|
||||||
resultObj = JSON.parse(res.stdout);
|
resultObj = JSON.parse(res.stdout);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -185,9 +185,9 @@ function getFilePathsConfigs() {
|
|||||||
catch (ex) {
|
catch (ex) {
|
||||||
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
|
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
|
||||||
}
|
}
|
||||||
if (!resultObj) {
|
if (resultObj) {
|
||||||
resultObj = resultObj[0];
|
resultObj = resultObj[0];
|
||||||
if (!(resultObj.Config) && !(resultObj.Config.Labels) && !(resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
|
if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
|
||||||
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,7 +176,7 @@ export async function getFilePathsConfigs(): Promise<any> {
|
|||||||
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)![0]}`);
|
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)![0]}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!res.stdout){
|
if(res.stdout){
|
||||||
resultObj = JSON.parse(res.stdout);
|
resultObj = JSON.parse(res.stdout);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -185,9 +185,9 @@ export async function getFilePathsConfigs(): Promise<any> {
|
|||||||
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
|
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!resultObj){
|
if(resultObj){
|
||||||
resultObj = resultObj[0];
|
resultObj = resultObj[0];
|
||||||
if(!(resultObj.Config) && !(resultObj.Config.Labels) && !(resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
|
if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
|
||||||
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user