Commit 5fe16eb
committed
Fix --tag parameter to properly publish versioned tags
Motivation:
The `--tag` parameter was accepted but never used when publishing images.
The manifest and index were always pushed using `destinationImage.reference`
(defaulting to 'latest'), ignoring the user-specified tag entirely.
Modifications:
- Collect both the `--tag` value and the repository reference into a list
- Push the manifest and index to each tag in the list
- Skip duplicates when `--tag` matches the repository reference
- Return the `--tag` as the primary reference in the result
Result:
Running `swift package build-container-image --repository ghcr.io/org/app --tag v1.0.0`
now correctly pushes to both `v1.0.0` and `latest` tags.
Test Plan:
Tested with attendix-backend by building and pushing to ghcr.io.
Verified both tags appear in the registry after a single build command.1 parent 1ea1608 commit 5fe16eb
File tree
1 file changed
+43
-41
lines changed- Sources/containertool/Extensions
1 file changed
+43
-41
lines changedLines changed: 43 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
148 | 147 | | |
149 | 148 | | |
150 | | - | |
| 149 | + | |
151 | 150 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
164 | 157 | | |
165 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
166 | 161 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
172 | 174 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
185 | 184 | | |
186 | 185 | | |
| 186 | + | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
0 commit comments