diff --git a/VERSION b/VERSION index 589268e..e21e727 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 \ No newline at end of file +1.4.0 \ No newline at end of file diff --git a/cmd/sync.go b/cmd/sync.go index c1991f0..7e41c53 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -163,6 +163,7 @@ func init() { syncCmd.Flags().StringVar(&pcmd.Repository.Auth.Username, "repository.auth.username", "", "username to perform authentication") syncCmd.Flags().StringVar(&pcmd.Repository.Auth.Password, "repository.auth.password", "", "password to perform authentication") syncCmd.Flags().StringVar(&pcmd.Repository.Branch, "repository.branch", "main", "path to clone the git repository") + syncCmd.Flags().StringVar(&pcmd.Repository.Proxy, "repository.proxy", "", "https proxy url") syncCmd.Flags().StringVar(&pcmd.Namespace, "namespace", "default", "namespace that will store the dashboard config map") syncCmd.Flags().StringVar(&pcmd.DashboardLabels, "dashboard.labels", "grafana_dashboard=nil", "dashboard label selector") syncCmd.Flags().StringVar(&pcmd.DashboardFolderAnnotation, "dashboard.folder-annotation", "", "dashboard folder annotation") diff --git a/internal/gitmanager/gitmanager.go b/internal/gitmanager/gitmanager.go index ff4e75a..17e0fd6 100644 --- a/internal/gitmanager/gitmanager.go +++ b/internal/gitmanager/gitmanager.go @@ -21,6 +21,7 @@ type Repository struct { Url string Path string Branch string + Proxy string DashboardPath string Auth RepositoryAuth } @@ -56,10 +57,11 @@ func (r Repository) Validate() error { } func (r *Repository) Get(ctx context.Context) (bool, error) { - if httpsProxy := os.Getenv("HTTPS_PROXY"); httpsProxy != "" { - logrus.Debugf("using proxy %v", httpsProxy) - proxyUrl, err := url.Parse(httpsProxy) + if r.Proxy != "" { + logrus.Debugf("using proxy %v", r.Proxy) + + proxyUrl, err := url.Parse(r.Proxy) if err != nil { return false, err