mirror of
https://github.com/portainer/portainer.git
synced 2026-08-07 09:54:49 +00:00
fix(workflows): fix workflow access BE-13150 (#3032)
This commit is contained in:
@@ -63,6 +63,7 @@ func FetchWorkflows(
|
||||
for _, stack := range preFiltered {
|
||||
wf := workflowMap[stack.WorkflowID]
|
||||
|
||||
hasAccessibleSource := false
|
||||
outer:
|
||||
for _, as := range wf.Artifacts {
|
||||
if as.StackID != stack.ID {
|
||||
@@ -70,7 +71,13 @@ func FetchWorkflows(
|
||||
}
|
||||
|
||||
for _, f := range as.Files {
|
||||
src := sourceMap[f.SourceID]
|
||||
src, ok := sourceMap[f.SourceID]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
hasAccessibleSource = true
|
||||
|
||||
if src.Type == portainer.SourceTypeGit {
|
||||
gitConfigs[stack.ID] = MergeSourceAndFile(&src, &f)
|
||||
break outer
|
||||
@@ -78,6 +85,10 @@ func FetchWorkflows(
|
||||
}
|
||||
}
|
||||
|
||||
if stack.Type == portainer.KubernetesStack && !hasAccessibleSource {
|
||||
continue
|
||||
}
|
||||
|
||||
filtered = append(filtered, stack)
|
||||
}
|
||||
stacks = filtered
|
||||
|
||||
Reference in New Issue
Block a user