Mohammed Nafees 3 년 전
부모
커밋
10243fb9ac
1개의 변경된 파일11개의 추가작업 그리고 9개의 파일을 삭제
  1. 11 9
      api/server/handlers/helmrepo/update.go

+ 11 - 9
api/server/handlers/helmrepo/update.go

@@ -51,7 +51,17 @@ func (p *HelmRepoUpdateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
 		return
 		return
 	}
 	}
 
 
-	if helmRepo.BasicAuthIntegrationID != 0 {
+	request := &types.CreateUpdateHelmRepoRequest{}
+
+	ok := p.DecodeAndValidate(w, r, request)
+
+	if !ok {
+		return
+	}
+
+	if request.BasicIntegrationID != 0 &&
+		helmRepo.BasicAuthIntegrationID != 0 &&
+		request.BasicIntegrationID != helmRepo.BasicAuthIntegrationID {
 		bi, err := p.Repo().BasicIntegration().ReadBasicIntegration(proj.ID, helmRepo.BasicAuthIntegrationID)
 		bi, err := p.Repo().BasicIntegration().ReadBasicIntegration(proj.ID, helmRepo.BasicAuthIntegrationID)
 
 
 		if err != nil {
 		if err != nil {
@@ -69,14 +79,6 @@ func (p *HelmRepoUpdateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
 		}
 		}
 	}
 	}
 
 
-	request := &types.CreateUpdateHelmRepoRequest{}
-
-	ok := p.DecodeAndValidate(w, r, request)
-
-	if !ok {
-		return
-	}
-
 	// if a basic integration is specified, verify that it exists in the project
 	// if a basic integration is specified, verify that it exists in the project
 	if request.BasicIntegrationID != 0 {
 	if request.BasicIntegrationID != 0 {
 		_, err := p.Repo().BasicIntegration().ReadBasicIntegration(proj.ID, request.BasicIntegrationID)
 		_, err := p.Repo().BasicIntegration().ReadBasicIntegration(proj.ID, request.BasicIntegrationID)