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
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,
})
}