mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-11 16:52: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) {
|
||||
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)[0]}`);
|
||||
}
|
||||
if (!res.stdout) {
|
||||
if (res.stdout) {
|
||||
resultObj = JSON.parse(res.stdout);
|
||||
}
|
||||
});
|
||||
@ -185,9 +185,9 @@ function getFilePathsConfigs() {
|
||||
catch (ex) {
|
||||
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
|
||||
}
|
||||
if (!resultObj) {
|
||||
if (resultObj) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ export async function getFilePathsConfigs(): Promise<any> {
|
||||
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)![0]}`);
|
||||
}
|
||||
|
||||
if(!res.stdout){
|
||||
if(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);
|
||||
}
|
||||
|
||||
if(!resultObj){
|
||||
if(resultObj){
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user