From 680d6244ed7e260bd5027f1f27f4cf43e33e81eb Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 16 Apr 2026 21:58:04 -0700 Subject: [PATCH] Support GitHub Enterprise server in plugin/load_db service Signed-off-by: Dom Del Nano (cherry picked from commit 10ba42646d5b344a39ac75d161aa5155ee84bdd0) --- src/cloud/plugin/load_db/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cloud/plugin/load_db/main.go b/src/cloud/plugin/load_db/main.go index 6cb9c946520..367860fad0c 100644 --- a/src/cloud/plugin/load_db/main.go +++ b/src/cloud/plugin/load_db/main.go @@ -50,7 +50,7 @@ import ( "px.dev/pixie/src/utils" ) -const githubArchiveTmpl = "https://api.github.com/repos/%s/tarball" +const githubArchiveTmpl = "https://%s/repos/%s/tarball" // NOTE: After changing this file, remember to push a generated image by running // bazel run //src/cloud/plugin/load_db:push_plugin_db_updater_image @@ -58,6 +58,7 @@ func init() { pflag.String("plugin_repo", "pixie-io/pixie-plugin", "The name of the plugin repo.") pflag.String("plugin_service", "plugin-service.plc.svc.cluster.local:50600", "The plugin service url (load balancer/list is ok)") pflag.String("domain_name", "dev.withpixie.dev", "The domain name of Pixie Cloud") + pflag.String("gh_api_host", "api.github.com", "The GitHub API host (e.g. api.github.com for github.com, or ghe.example.com/api/v3 for GitHub Enterprise Server)") } func initDB() *sqlx.DB { @@ -98,7 +99,7 @@ func loadPlugins(db *sqlx.DB) { } client := http.Client{} - req, err := http.NewRequest("GET", fmt.Sprintf(githubArchiveTmpl, pluginRepo), nil) + req, err := http.NewRequest("GET", fmt.Sprintf(githubArchiveTmpl, viper.GetString("gh_api_host"), pluginRepo), nil) if err != nil { log.WithError(err).Fatal("Failed to create req") }