Commit 616501d
cmd/list, pkg/podman: Make podman.GetImages() flatten, not getImages()
This is a step towards eliminating or reducing the code in getImages()
by doing everything or more in podman.GetImages(). If nothing else,
this removes the need to export Image.FlattenNames() from the podman
package.
The getImages() function originated as listContainers(), when it invoked
'podman images --filter label=...' through podman.GetImages() separately
for each label used to identify Toolbx images, and then joined and
sorted the results. This changed in commit 2369da5 when
getImages() started invoking 'podman images' only once through
podman.GetImages() to get all available images, and then filtered them
itself based on the labels.
Before this change in commit 2369da5, it probably made some
sense to keep podman.GetImages() only as a thin wrapper to invoke
'podman images' with different options, and to do everything else in
getImages(). However, since then more is being done inside the podman
package (eg., unmarshalling the 'podman images' JSON in commit
5f324d5 and flattening the images in commit 6aab0a6),
and getImages() is the only caller of podman.GetImages().
Therefore, it looks awkward to have the code to get all Toolbx images
split across two functions in different packages.
containers#1724
containers#17721 parent 52ef378 commit 616501d
2 files changed
Lines changed: 19 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 166 | | |
173 | 167 | | |
174 | 168 | | |
| |||
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
182 | | - | |
183 | | - | |
| 176 | + | |
184 | 177 | | |
185 | 178 | | |
186 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
198 | | - | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
213 | 228 | | |
214 | 229 | | |
215 | 230 | | |
| |||
0 commit comments