1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

fix(edge-stack) make protainer compatible with previous agent EE-5614 (#9220)

This commit is contained in:
cmeng 2023-07-18 09:25:29 +12:00 committed by GitHub
parent 8c533bee67
commit 7acd1080ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 6 deletions

View file

@ -75,12 +75,18 @@ func (handler *Handler) endpointEdgeStackInspect(w http.ResponseWriter, r *http.
return httperror.InternalServerError("Unable to load repository", err)
}
fileContent, err := filesystem.FilterDirForCompatibility(dirEntries, fileName, endpoint.Agent.Version)
if err != nil {
return httperror.InternalServerError("File not found", err)
}
dirEntries = filesystem.FilterDirForEntryFile(dirEntries, fileName)
return response.JSON(w, edge.StackPayload{
DirEntries: dirEntries,
EntryFileName: fileName,
Name: edgeStack.Name,
Namespace: namespace,
DirEntries: dirEntries,
EntryFileName: fileName,
StackFileContent: fileContent,
Name: edgeStack.Name,
Namespace: namespace,
})
}