You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tooling/image-updater/README.md
+87-6Lines changed: 87 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ When using `--env stg` or `--env prod`, the tool operates in **promotion mode**:
91
91
92
92
## Output Format
93
93
94
-
When the tool updates image digests in YAML files, it automatically adds inline comments with version tag and timestamp information:
94
+
When the tool updates image digests in YAML files, it automatically adds inline comments with version information and timestamp:
95
95
96
96
```yaml
97
97
defaults:
@@ -102,11 +102,28 @@ defaults:
102
102
103
103
This helps track:
104
104
105
-
- **Tag name**: The version or tag name (e.g., `v1.18.4`)
105
+
- **Version**: The version information from either:
106
+
- Container label (if `versionLabel` is configured) - e.g., a commit hash from `org.opencontainers.image.revision`
107
+
- Tag name (if no version label is configured) - e.g., `v1.18.4`
106
108
- **Timestamp**: When the image was created/published (format: `YYYY-MM-DD HH:MM`)
107
109
108
110
The comments are automatically generated and updated each time the tool runs.
109
111
112
+
### Version Labels
113
+
114
+
By default, when using the `tag` field (e.g., `tag: "latest"`), the tool automatically extracts version information from the `org.opencontainers.image.revision` container label if present. This provides meaningful version information even when using generic tags like "latest" or "stable".
115
+
116
+
You can customize the label to extract using the `versionLabel` field:
117
+
118
+
```yaml
119
+
source:
120
+
image: quay.io/example/image
121
+
tag: "latest"
122
+
versionLabel: "org.opencontainers.image.revision" # Default when using 'tag'
123
+
```
124
+
125
+
When using `tagPattern`, no version label is extracted by default (uses the tag name), but you can explicitly configure one if needed.
126
+
110
127
## Configuration
111
128
112
129
Define images to monitor and target files to update. Each image can optionally specify Azure Key Vault credentials for authentication.
@@ -158,6 +175,27 @@ images:
158
175
filePath: ../../config/config.yaml
159
176
env: dev
160
177
178
+
# Quay.io image pinned to specific version (e.g., during rollback)
| `tagPattern` | string | No | - | Regex pattern to filter tags (uses most recent if omitted) |
536
+
| `tag` | string | No | - | Exact tag to use (mutually exclusive with `tagPattern`) |
537
+
| `tagPattern` | string | No | - | Regex pattern to filter tags (mutually exclusive with `tag`) |
538
+
| `versionLabel` | string | No | `org.opencontainers.image.revision` (when using `tag`), empty (when using `tagPattern`) | Container label to extract for human-friendly version in comments and output table. Defaults to `org.opencontainers.image.revision` when using `tag` field. |
460
539
| `architecture` | string | No | `amd64` | Target architecture for single-arch images (`amd64`, `arm64`, etc.) |
461
540
| `multiArch` | bool | No | `false` | If `true`, fetches multi-arch manifest list digest |
462
541
| `useAuth` | bool | No | `false` | If `true`, uses authentication (required for private registries) |
@@ -466,6 +545,8 @@ Use `--verbosity 2` or higher when debugging authentication issues, tag filterin
466
545
467
546
**Notes**:
468
547
548
+
- `tag`and `tagPattern` are mutually exclusive - only one can be specified
549
+
- If neither `tag` nor `tagPattern` is specified, uses the most recently pushed tag
469
550
- `multiArch`and `architecture` are mutually exclusive
470
551
- `useAuth`defaults to `false` for all registries
471
552
- For private registries, explicitly set `useAuth: true`
returnnil, fmt.Errorf("no single-arch %s/linux image found for repository %s (all tags are either multi-arch or different architecture)", arch, repository)
212
216
}
217
+
218
+
// GetDigestForTag fetches the digest for a specific tag without pagination
returnnil, fmt.Errorf("tag %s has architecture %s/%s, but %s/linux was requested", tagName, string(*manifest.Architecture), string(*manifest.OperatingSystem), arch)
0 commit comments