Skip to content

Commit 680d624

Browse files
committed
Support GitHub Enterprise server in plugin/load_db service
Signed-off-by: Dom Del Nano <ddelnano@gmail.com> (cherry picked from commit 10ba426)
1 parent 57e15b3 commit 680d624

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
@@ -50,14 +50,15 @@ import (
5050
"px.dev/pixie/src/utils"
5151
)
5252

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

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

6364
func initDB() *sqlx.DB {
@@ -98,7 +99,7 @@ func loadPlugins(db *sqlx.DB) {
9899
}
99100

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

0 commit comments

Comments
 (0)