mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-27 15:19:27 +08:00
Review comment changes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user