Skip to content

Commit

Permalink
fix: deprecation warning on old git config in PR controller (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
corrieriluca authored Jan 16, 2025
1 parent 9d53b23 commit 3b38dc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/controllers/terraformpullrequest/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ func (r *Reconciler) initializeProvider(ctx context.Context, repository *configv
return provider, nil
}

// This function initializes default providers for the controller if user has provided legacy configuration
func (r *Reconciler) initializeDefaultProviders() error {
// This initializes default providers for the controller if user has provided legacy configuration
log.Warningf("deprecated GitHub/GitLab configuration found. please configure repositories with secrets instead. See https://padok-team.github.io/burrito/operator-manual/git-authentication/#repository-secret for more information.")
var config = gitprovider.Config{
AppID: r.Config.Controller.GithubConfig.AppId,
AppInstallationID: r.Config.Controller.GithubConfig.InstallationId,
AppPrivateKey: r.Config.Controller.GithubConfig.PrivateKey,
GitHubToken: r.Config.Controller.GithubConfig.APIToken,
GitLabToken: r.Config.Controller.GitlabConfig.APIToken,
URL: "https://github.com",
URL: r.Config.Controller.GitlabConfig.URL,
}

providers, err := gitprovider.ListAvailable(config, []string{gt.Capabilities.Changes, gt.Capabilities.Comment})
Expand Down

0 comments on commit 3b38dc9

Please sign in to comment.