Ivan Galakhov пре 4 година
родитељ
комит
62f67bb0fd
3 измењених фајлова са 7 додато и 4 уклоњено
  1. 4 1
      internal/models/gitrepo.go
  2. 1 1
      server/api/deploy_handler.go
  3. 2 2
      server/api/release_handler.go

+ 4 - 1
internal/models/gitrepo.go

@@ -62,7 +62,10 @@ type GitActionConfig struct {
 	ImageRepoURI string `json:"image_repo_uri"`
 
 	// The git installation ID
-	GithubInstallationID uint `json:"git_repo_id"`
+	GithubInstallationID uint `json:"git_installation_id"`
+
+	// The git repo ID (legacy field)
+	GitRepoID uint `json:"git_repo_id"`
 
 	// The path to the dockerfile in the git repo
 	DockerfilePath string `json:"dockerfile_path"`

+ 1 - 1
server/api/deploy_handler.go

@@ -352,7 +352,7 @@ func (app *App) HandleUninstallTemplate(w http.ResponseWriter, r *http.Request)
 
 				yaml.Unmarshal(rawValues, cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {

+ 2 - 2
server/api/release_handler.go

@@ -1028,7 +1028,7 @@ func (app *App) HandleUpgradeRelease(w http.ResponseWriter, r *http.Request) {
 
 				yaml.Unmarshal([]byte(form.Values), cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {
@@ -1408,7 +1408,7 @@ func (app *App) HandleRollbackRelease(w http.ResponseWriter, r *http.Request) {
 
 				yaml.Unmarshal(rawValues, cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {