mirror of https://github.com/containers/podman.git
Removing the RawInput from the API output
Including the RawInput in the API output is meaningless. Fixes: #16497 [NO NEW TESTS NEEDED] Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:
parent
0253d3cca2
commit
607cd39e15
|
@ -1024,7 +1024,7 @@ func (r *Runtime) RemoveDepend(ctx context.Context, rmCtr *Container, force bool
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, cID := range podContainerIDS {
|
for _, cID := range podContainerIDS {
|
||||||
rmReports = append(rmReports, &reports.RmReport{Id: cID, RawInput: cID})
|
rmReports = append(rmReports, &reports.RmReport{Id: cID})
|
||||||
}
|
}
|
||||||
return rmReports, nil
|
return rmReports, nil
|
||||||
}
|
}
|
||||||
|
@ -1052,7 +1052,7 @@ func (r *Runtime) RemoveDepend(ctx context.Context, rmCtr *Container, force bool
|
||||||
rmReports = append(rmReports, reports...)
|
rmReports = append(rmReports, reports...)
|
||||||
}
|
}
|
||||||
|
|
||||||
report := reports.RmReport{Id: rmCtr.ID(), RawInput: rmCtr.ID()}
|
report := reports.RmReport{Id: rmCtr.ID()}
|
||||||
report.Err = r.removeContainer(ctx, rmCtr, force, removeVolume, false, false, timeout)
|
report.Err = r.removeContainer(ctx, rmCtr, force, removeVolume, false, false, timeout)
|
||||||
return append(rmReports, &report), nil
|
return append(rmReports, &report), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ type CheckpointOptions struct {
|
||||||
type CheckpointReport struct {
|
type CheckpointReport struct {
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
Id string `json:"Id"` //nolint:revive,stylecheck
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
RawInput string `json:"RawInput"`
|
RawInput string `json:"-"`
|
||||||
RuntimeDuration int64 `json:"runtime_checkpoint_duration"`
|
RuntimeDuration int64 `json:"runtime_checkpoint_duration"`
|
||||||
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ type RestoreOptions struct {
|
||||||
type RestoreReport struct {
|
type RestoreReport struct {
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
Id string `json:"Id"` //nolint:revive,stylecheck
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
RawInput string `json:"RawInput"`
|
RawInput string `json:"-"`
|
||||||
RuntimeDuration int64 `json:"runtime_restore_duration"`
|
RuntimeDuration int64 `json:"runtime_restore_duration"`
|
||||||
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package reports
|
||||||
type RmReport struct {
|
type RmReport struct {
|
||||||
Id string `json:"Id"` //nolint:revive,stylecheck
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
Err error `json:"Err,omitempty"`
|
Err error `json:"Err,omitempty"`
|
||||||
RawInput string
|
RawInput string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func RmReportsIds(r []*RmReport) []string {
|
func RmReportsIds(r []*RmReport) []string {
|
||||||
|
|
|
@ -273,6 +273,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
|
||||||
}
|
}
|
||||||
for i := range newReports {
|
for i := range newReports {
|
||||||
alreadyRemoved[newReports[i].Id] = true
|
alreadyRemoved[newReports[i].Id] = true
|
||||||
|
newReports[i].RawInput = idToRawInput[newReports[i].Id]
|
||||||
rmReports = append(rmReports, newReports[i])
|
rmReports = append(rmReports, newReports[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue