Minor fix for Gitops Notifier (#2426)

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
This commit is contained in:
Soumya Ghosh Dastidar 2021-02-02 13:30:31 +05:30 committed by GitHub
parent 4782126543
commit aa4f1e2828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -105,7 +105,9 @@ func GitOpsNotificationHandler(ctx context.Context, clusterInfo model.ClusterIde
log.Print("Could not get workflow :", err)
return "could not get workflow", err
}
if len(workflows) == 0 {
return "", errors.New("no such workflow found")
}
resKind := gjson.Get(workflows[0].WorkflowManifest, "kind").String()
if strings.ToLower(resKind) == "cronworkflow" { // no op
return "Request Acknowledged for workflowID: " + workflowID, nil