Skip to content

fix: update inspektor gadget v0.51.0 compatibility#8396

Open
burak-ok wants to merge 3 commits intomainfrom
burak/ig/v0.51.0
Open

fix: update inspektor gadget v0.51.0 compatibility#8396
burak-ok wants to merge 3 commits intomainfrom
burak/ig/v0.51.0

Conversation

@burak-ok
Copy link
Copy Markdown

What this PR does / why we need it:

  • Update Inspektor Gadget to v0.51.0
  • Stop treating ig and ig-gadgets revision suffixes as a compatibility requirement for every OS

Which issue(s) this PR fixes:

Supersedes #8045 (ig-gadgets v0.51.1 is not available yet)

Copilot AI review requested due to automatic review settings April 24, 2026 13:21
@github-actions github-actions Bot added the components This pull request updates cached components on Linux or Windows VHDs label Apr 24, 2026
@burak-ok burak-ok changed the title fix: Update inspektor gadget v0.51.0 compatibility fix: update inspektor gadget v0.51.0 compatibility Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the VHD build inputs/tests to support Inspektor Gadget v0.51.0 while relaxing the igig-gadgets compatibility check to require only matching upstream X.Y.Z versions (allowing distro/package revision skew).

Changes:

  • Bump inspektor-gadget (ig) versions in parts/common/components.json to 0.51.0 across Ubuntu and Azure Linux.
  • Update VHD content tests to validate ig/ig-gadgets compatibility by upstream version (not full distro revision).
  • Update VHD build install logic to enforce upstream-version compatibility between ig and the pinned ig-gadgets version, 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.

Comment thread vhdbuilder/packer/install-ig.sh Outdated
return 0
fi

echo "[ig] Could not parse upstream version from '${version}'"
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
echo "[ig] Could not parse upstream version from '${version}'"
echo "[ig] Could not parse upstream version from '${version}'" >&2

Copilot uses AI. Check for mistakes.
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread vhdbuilder/packer/install-ig.sh Outdated
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}"
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components This pull request updates cached components on Linux or Windows VHDs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants