Fix: Prevent crash when kubeconfig context reference null clusters#715
Open
tejhan wants to merge 159 commits into
Open
Fix: Prevent crash when kubeconfig context reference null clusters#715tejhan wants to merge 159 commits into
tejhan wants to merge 159 commits into
Conversation
Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
So it just uses the name. Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
…mand execution This improves performance by avoiding repeated shell environment queries and ensures consistent environment variables across commands. Co-authored-by: Santhosh Nagaraj <sannagaraj@microsoft.com> Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
… execution This enables AKS Desktop plugin functionality and improves command execution by using the cached shell environment for better PATH resolution and consistent environment variables. Co-authored-by: Santhosh Nagaraj <sannagaraj@microsoft.com> Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
…ugin integration This extends the frontend to support kubectl commands and integrates the AKS Desktop plugin with proper permission handling and command execution capabilities. Co-authored-by: Santhosh Nagaraj <sannagaraj@microsoft.com> Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
this patch updates the product name which affects the final binary name Signed-off-by: yolossn <sannagaraj@microsoft.com>
this patch removes the initialise in the app start since it was blocking the rendering process in windows. This is fixed by calling the getShellEnvironment in runCmd and make sure getShellEnvironment caches the values instead of running on each call Signed-off-by: yolossn <sannagaraj@microsoft.com>
this patch adds consent to aks-desktop specific commands by default to avoid the user consent popups Signed-off-by: yolossn <sannagaraj@microsoft.com>
Signed-off-by: yolossn <sannagaraj@microsoft.com>
…native So we're more compatible with different platforms.
frontend: EditorDialog: Ensure editor is visible on high zoom by providing proper scrolling
…-section-truncation frontend:Resource: Fix ConditionsTable truncation on resize
Removed previous Empty change for no data announce, because it works on windows narrator not nvda, and otherwise it would double announce.
frontend: Table: SimpleTable: Fix announce of no data
SimpleTable: Remove hidden overflow for table cells
i18n: Distribute latest translations
upstreamable: resourceMap: group unscheduled pods in node view
frontend: Add AppInsights connection string
…ening aksd: harden App Insights telemetry to anonymous app-usage counts
frontend: Reenable i18n LanguageDetector
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request hardens kubeconfig parsing in the backend to avoid panics when the kubeconfig contains contexts but the top-level clusters field is null/missing, returning a normal error instead so the process can continue running.
Changes:
- Replaced the unsafe type assertion in
getClusterwith a comma-okassertion. - Returns a graceful error when
kubeconfig["clusters"]is missing/invalid instead of panicking.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tejhan
force-pushed
the
fix/kubeconfig-nil-clusters-crash
branch
from
June 4, 2026 15:08
46e4c62 to
992e589
Compare
…ull clusters Signed-off-by: tejhan-diallo <tejhan.diallo@gmail.com>
tejhan
force-pushed
the
fix/kubeconfig-nil-clusters-crash
branch
from
June 4, 2026 15:20
992e589 to
b6c045a
Compare
sniok
force-pushed
the
headlamp-downstream
branch
from
July 1, 2026 15:43
c1420ee to
551275e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where if the kubeconfig has contexts but
clusterfields set to null. This issue surfaces in 2 ways:A kubeconfig with both
clustersandcontextsset to null is safe since we skip callinggetClusterbut in the case of present contexts & null clusters (which can happen frequently when modifying kubeconfig via external tools), thegetClusterlogic fails.The failure was due to it's type assertion that paniced on nil.
To resolve this, implemented an
okassertion, falling in line with existing handler logic we have in thegetUserfunction.Now when a context references a nil clusters field, an error is returned gracefully and the backend continues running.
Type of Change
Changes Made
getClusterto gracefully return an error on nilnull_clusters_with_contexts_no_panicandkubeconfig_null_clustersto reproduce malformed kubeconfigTesting
cluster:"".npm run devThis original issue can be replicated by performing the above steps 1 & 2 and observing a failed startup.