api: fix doc for default ps_args

The libpod API does not set a default. Also PodTop is podman sepecific
so we can just rmeove this extra branch there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-06-29 11:12:52 +02:00
parent 5d706eb027
commit dbec2b5aa2
3 changed files with 3 additions and 8 deletions

View File

@ -362,17 +362,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))

View File

@ -1174,7 +1174,7 @@ 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.

View File

@ -309,7 +309,7 @@ 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.