mirror of
https://github.com/containers/podman.git
synced 2026-10-27 20:29:39 -04:00
Merge pull request #19066 from Luap99/ps
top: do not depend on ps(1) in container
This commit is contained in:
17 files changed
+376
-71
No files matched your search
@@ -376,17 +376,12 @@ func PodTop(w http.ResponseWriter, r *http.Request) {
|
||||
runtime := r.Context().Value(api.RuntimeKey).(*libpod.Runtime)
|
||||
decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder)
|
||||
|
||||
psArgs := "-ef"
|
||||
if utils.IsLibpodRequest(r) {
|
||||
psArgs = ""
|
||||
}
|
||||
query := struct {
|
||||
Delay int `schema:"delay"`
|
||||
PsArgs string `schema:"ps_args"`
|
||||
Stream bool `schema:"stream"`
|
||||
}{
|
||||
Delay: 5,
|
||||
PsArgs: psArgs,
|
||||
Delay: 5,
|
||||
}
|
||||
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
|
||||
utils.Error(w, http.StatusBadRequest, fmt.Errorf("failed to parse parameters for %s: %w", r.URL.String(), err))
|
||||
|
||||
@@ -444,7 +444,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
|
||||
// name: ps_args
|
||||
// type: string
|
||||
// default: -ef
|
||||
// description: arguments to pass to ps such as aux. Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used.
|
||||
// description: arguments to pass to ps such as aux.
|
||||
// produces:
|
||||
// - application/json
|
||||
// responses:
|
||||
@@ -1174,10 +1174,9 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
|
||||
// - in: query
|
||||
// name: ps_args
|
||||
// type: string
|
||||
// default: -ef
|
||||
// default:
|
||||
// description: |
|
||||
// arguments to pass to ps such as aux.
|
||||
// Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used.
|
||||
// produces:
|
||||
// - application/json
|
||||
// responses:
|
||||
|
||||
@@ -309,10 +309,9 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
|
||||
// - in: query
|
||||
// name: ps_args
|
||||
// type: string
|
||||
// default: -ef
|
||||
// default:
|
||||
// description: |
|
||||
// arguments to pass to ps such as aux.
|
||||
// Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used.
|
||||
// responses:
|
||||
// 200:
|
||||
// $ref: "#/responses/podTopResponse"
|
||||
|
||||
Reference in new issue
Block a user