Skip to content

Commit 10ba426

Browse files
committed
Support GitHub Enterprise server in plugin/load_db service
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 923aad9 commit 10ba426

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/cloud/plugin/load_db/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ import (
5151
"px.dev/pixie/src/utils"
5252
)
5353

54-
const githubArchiveTmpl = "https://api.github.com/repos/%s/tarball"
54+
const githubArchiveTmpl = "https://%s/repos/%s/tarball"
5555

5656
// NOTE: After changing this file, remember to push a generated image by running
5757
// bazel run //src/cloud/plugin/load_db:push_plugin_db_updater_image
5858
func init() {
5959
pflag.String("plugin_repo", "pixie-io/pixie-plugin", "The name of the plugin repo.")
6060
pflag.String("plugin_service", "plugin-service.plc.svc.cluster.local:50600", "The plugin service url (load balancer/list is ok)")
6161
pflag.String("domain_name", "dev.withpixie.dev", "The domain name of Pixie Cloud")
62+
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)")
6263
}
6364

6465
func initDB() *sqlx.DB {
@@ -99,7 +100,7 @@ func loadPlugins(db *sqlx.DB) {
99100
}
100101

101102
client := http.Client{}
102-
req, err := http.NewRequest("GET", fmt.Sprintf(githubArchiveTmpl, pluginRepo), nil)
103+
req, err := http.NewRequest("GET", fmt.Sprintf(githubArchiveTmpl, viper.GetString("gh_api_host"), pluginRepo), nil)
103104
if err != nil {
104105
log.WithError(err).Fatal("Failed to create req")
105106
}

0 commit comments

Comments
 (0)