Skip to content

Conversation

mqasimsarfraz
Copy link
Member

@mqasimsarfraz mqasimsarfraz commented Aug 8, 2025

This PR makes changes to handle "Day 2" of inspektor_gadget_observability tool. It adds upgrade action to allow users to upgrade Inspektor Gadget. Also, includes this version information in the is_deployed to hint for an upgrade.

Other improvements include aligning gadget version with Inspektor Gadget version to ensure compatibility. Also, runtime now always uses the latest kubeconfig to ensure if user does get-credentials they don't need to restart the server and introducing lock formatter which we need as part of new IG release.

Testing Done

I have included some tests. Also, asked copilot to do some testing.

This change adds upgrade action to allow users to upgrade Inspektor Gadget.
It aligns gadget version with Inspektor Gadget version to ensure compatibility.

Also, we setup the grpcruntime at runtime to ensure lastest kubeconfig is used

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 19.01408% with 115 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7c80b0e). Learn more about missing BASE report.
⚠️ Report is 45 commits behind head on main.

Files with missing lines Patch % Lines
...ternal/components/inspektorgadget/gadgetmanager.go 0.00% 55 Missing ⚠️
internal/components/inspektorgadget/handlers.go 9.80% 44 Missing and 2 partials ⚠️
internal/components/inspektorgadget/helpers.go 56.25% 10 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #142   +/-   ##
=======================================
  Coverage        ?   34.82%           
=======================================
  Files           ?       53           
  Lines           ?     5309           
  Branches        ?        0           
=======================================
  Hits            ?     1849           
  Misses          ?     3379           
  Partials        ?       81           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gossion gossion requested a review from Copilot August 11, 2025 05:18
Copy link
Contributor

@Copilot 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 enhances the Inspektor Gadget observability tool by adding upgrade functionality for "Day 2" operations. It introduces an upgrade action that allows users to upgrade their Inspektor Gadget deployment and includes version information in deployment status checks to hint when upgrades are available.

Key changes include:

  • Added upgrade action with version checking and Helm upgrade command execution
  • Modified gadget image handling to use dynamic versioning based on Inspektor Gadget version
  • Refactored runtime initialization to always use latest kubeconfig without requiring server restart

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/server/server.go Simplified gadget manager initialization by removing error handling
internal/components/inspektorgadget/registry.go Added upgrade action to tool description
internal/components/inspektorgadget/helpers_test.go Added tests for gadget version mapping function
internal/components/inspektorgadget/helpers.go Added version mapping logic and caching for GitHub version retrieval
internal/components/inspektorgadget/handlers_test.go Updated mock interface to include GetVersion method
internal/components/inspektorgadget/handlers.go Added upgrade action handler and enhanced version checking
internal/components/inspektorgadget/gadgets_test.go Added test to ensure gadget images don't contain version tags
internal/components/inspektorgadget/gadgets.go Removed hardcoded version tags and added dynamic image method
internal/components/inspektorgadget/gadgetmanager.go Refactored runtime handling and added GetVersion method
internal/components/inspektorgadget/const.go Added upgrade action constant
docs/inspektor-gadget-usage.md Updated documentation to reflect that kubeconfig restart is no longer needed

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
@gossion
Copy link
Member

gossion commented Aug 12, 2025

lgtm

@gossion gossion merged commit d7f03c0 into Azure:main Aug 12, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants