Addressed review comments.

This commit is contained in:
Koushik Dey
2020-08-27 17:14:59 +05:30
parent 3a1c0b10eb
commit 65e1224846
10 changed files with 133 additions and 131 deletions
@@ -122,8 +122,8 @@ function annotateResources(files, kubectl, resourceTypes, allPods, annotationKey
const annotateResults = [];
const lastSuccessSha = utility_1.getLastSuccessfulRunSha(kubectl, TaskInputParameters.namespace, annotationKey);
let annotationKeyValStr = annotationKey + '=' + models.getWorkflowAnnotationsJson(lastSuccessSha);
annotateResults.push(kubectl.annotate('namespace', TaskInputParameters.namespace, [annotationKeyValStr], true));
annotateResults.push(kubectl.annotateFiles(files, [annotationKeyValStr], true));
annotateResults.push(kubectl.annotate('namespace', TaskInputParameters.namespace, annotationKeyValStr));
annotateResults.push(kubectl.annotateFiles(files, annotationKeyValStr));
resourceTypes.forEach(resource => {
if (resource.type.toUpperCase() !== models.KubernetesWorkload.pod.toUpperCase()) {
utility_1.annotateChildPods(kubectl, resource.type, resource.name, annotationKeyValStr, allPods)
@@ -137,7 +137,7 @@ function labelResources(files, kubectl, label) {
workflowName = workflowName.startsWith('.github/workflows/') ?
workflowName.replace(".github/workflows/", "") : workflowName;
const labels = [`workflowFriendlyName=${workflowName}`, `workflow=${label}`];
utility_1.checkForErrors([kubectl.labelFiles(files, labels, true)], true);
utility_1.checkForErrors([kubectl.labelFiles(files, labels)], true);
}
function updateResourceObjects(filePaths, imagePullSecrets, containers) {
const newObjectsList = [];