fix: update inspektor gadget v0.51.0 compatibility#8396
fix: update inspektor gadget v0.51.0 compatibility#8396
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the VHD build inputs/tests to support Inspektor Gadget v0.51.0 while relaxing the ig ↔ ig-gadgets compatibility check to require only matching upstream X.Y.Z versions (allowing distro/package revision skew).
Changes:
- Bump
inspektor-gadget(ig) versions inparts/common/components.jsonto0.51.0across Ubuntu and Azure Linux. - Update VHD content tests to validate
ig/ig-gadgetscompatibility by upstream version (not full distro revision). - Update VHD build install logic to enforce upstream-version compatibility between
igand the pinnedig-gadgetsversion, and add ShellSpec coverage for the helper functions.
Package Update Analysis: inspektor-gadget (ig)
Version change: 0.49.1-* → 0.51.0-* (minor update)
OS variants affected: Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04, Azure Linux 3.0
OS variants NOT updated: None — full coverage (for the variants listed under inspektor-gadget in components.json)
Upstream changelog not found for this version range in-repo. Manual testing recommended before merge (at minimum: VHD build install path + ig-import-gadgets.service enablement + gadget import tracking file validation).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
vhdbuilder/packer/test/linux-vhd-content-test.sh |
Adds helpers to normalize IG versions and updates the IG asset test to compare upstream X.Y.Z. |
vhdbuilder/packer/install-ig.sh |
Updates pinned ig-gadgets versions and enforces upstream-version compatibility during VHD build installation. |
spec/vhdbuilder/packer/test/linux_vhd_content_test_helpers_spec.sh |
Adds ShellSpec tests for the new IG version parsing/comparison helpers. |
parts/common/components.json |
Bumps ig versions for Ubuntu and Azure Linux to 0.51.0 with updated revision suffixes. |
| return 0 | ||
| fi | ||
|
|
||
| echo "[ig] Could not parse upstream version from '${version}'" |
There was a problem hiding this comment.
In ig_extract_upstream_version, the parse-failure message is echoed to stdout. Because callers capture this function via command substitution (e.g., ig_upstream=$(ig_extract_upstream_version ...)), the error text is swallowed into the variable and never reaches logs, making failures hard to diagnose. Please send the error message to stderr (or log from the caller) before returning non-zero.
| echo "[ig] Could not parse upstream version from '${version}'" | |
| echo "[ig] Could not parse upstream version from '${version}'" >&2 |
Write ig_extract_upstream_version parse failures to stderr so command-substitution callers do not swallow diagnostics, and add shellspec coverage for the helper behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| ig_gadgets_upstream=$(ig_extract_upstream_version "${ig_gadgets_version}") || return 1 | ||
|
|
||
| if [[ "${ig_upstream}" != "${ig_gadgets_upstream}" ]]; then | ||
| echo "[ig] ig (${IG_VERSION}) and ig-gadgets (${ig_gadgets_version}) must share upstream version, found ${ig_upstream} vs ${ig_gadgets_upstream}" |
There was a problem hiding this comment.
The version-mismatch error message is echoed to stdout. Since this is an error path (and the function returns non-zero), it should write to stderr (e.g., redirect echo to >&2) so failures are reliably surfaced/grep-able in build logs.
| echo "[ig] ig (${IG_VERSION}) and ig-gadgets (${ig_gadgets_version}) must share upstream version, found ${ig_upstream} vs ${ig_gadgets_upstream}" | |
| echo "[ig] ig (${IG_VERSION}) and ig-gadgets (${ig_gadgets_version}) must share upstream version, found ${ig_upstream} vs ${ig_gadgets_upstream}" >&2 |
Write the ig_validate_version_compatibility mismatch message to stderr and extend shellspec coverage for the error path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
What this PR does / why we need it:
igandig-gadgetsrevision suffixes as a compatibility requirement for every OSWhich issue(s) this PR fixes:
Supersedes #8045 (ig-gadgets v0.51.1 is not available yet)