Review comment changes

This commit is contained in:
Jyotsna
2020-11-23 13:37:57 +05:30
parent d8b8394d0c
commit 87732d1861
3 changed files with 13 additions and 15 deletions
+6 -6
View File
@@ -150,8 +150,8 @@ function getFilePathsConfigs() {
const CONTAINER_REG_KEY = 'containerRegistryServer';
let inputManifestFiles = inputParams.manifests || [];
filePathsConfig[MANIFEST_PATHS_KEY] = JSON.stringify(inputManifestFiles);
let helmChartPath = process.env.HELM_CHART_PATH || '';
filePathsConfig[HELM_CHART_KEY] = helmChartPath;
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
filePathsConfig[HELM_CHART_KEY] = helmChartPaths;
//Fetch labels from each image
let imageToBuildConfigMap = {};
let imageNames = core.getInput('images').split('\n');
@@ -180,7 +180,7 @@ function getFilePathsConfigs() {
if (res.stderr != '' && !res.success) {
throw new Error(`docker inspect call failed with: ${res.stderr.match(/(.*)\s*$/)[0]}`);
}
if (res.stdout != null && res.stdout != '') {
if (!res.stdout) {
resultObj = JSON.parse(res.stdout);
}
});
@@ -188,14 +188,14 @@ function getFilePathsConfigs() {
catch (ex) {
core.warning(`Failed to get dockerfile paths for image ${image.toString()} | ` + ex);
}
if (resultObj != null) {
if (!resultObj) {
resultObj = resultObj[0];
if (resultObj.Config != null && resultObj.Config.Labels != null && resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY] != null) {
if (!(resultObj.Config) && !(resultObj.Config.Labels) && !(resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
buildConfigMap[DOCKERFILE_PATH_KEY] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
}
//Add CR server name to build config
buildConfigMap[CONTAINER_REG_KEY] = containerRegistryName;
if (resultObj.Id != null) {
if (!resultObj.Id) {
imageToBuildConfigMap[resultObj.Id] = buildConfigMap;
}
}