Skip to content

Commit 5e89acc

Browse files
main sync
2 parents b84ac07 + d0ddb67 commit 5e89acc

File tree

87 files changed

+2955
-1748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2955
-1748
lines changed

CHANGELOG/release-notes-v1.4.0.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## v1.4.0
2+
3+
## Enhancements
4+
- feat: Made ng labels env driven (#6438)
5+
- feat: Link helm release (#6454)
6+
- feat: access manager (#6377)
7+
- feat: migrate external argo cd application (#6303)
8+
- feat: Dark Mode v1 (#2348)
9+
- feat: Dark Mode v2 (#2367)
10+
- feat: Dark Mode v3 (#2484)
11+
## Bugs
12+
- fix: cluster update issue (#6465)
13+
- fix: in CreateGrafanaDataSource (#6463)
14+
- fix: onboard acd app (#6457)
15+
- fix: prom client in chart-sync (#6442)
16+
- fix: incorrect gitops metrics (#6444)
17+
- fix: envId check in EventBuilder.go (#6436)
18+
- fix: createDockerRepoIfNeeded error handling (#6433)
19+
20+

api/bean/ConfigMapAndSecret.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ func GetTransformedDataForSecretRootJsonData(data string, mode util.SecretTransf
8080
}
8181

8282
for _, configData := range secretsJson.ConfigSecretJson.Secrets {
83+
if configData.Data == nil || configData.External {
84+
continue
85+
}
8386
configData.Data, err = util.GetDecodedAndEncodedData(configData.Data, mode)
8487
if err != nil {
8588
return "", err

api/helm-app/HelmAppRestHandler.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ type HelmAppRestHandler interface {
6262
UpdateApplication(w http.ResponseWriter, r *http.Request)
6363
TemplateChart(w http.ResponseWriter, r *http.Request)
6464
SaveHelmAppDetailsViewedTelemetryData(w http.ResponseWriter, r *http.Request)
65+
ListHelmApplicationsForEnvironment(w http.ResponseWriter, r *http.Request)
6566
}
6667

6768
const HELM_APP_ACCESS_COUNTER = "HelmAppAccessCounter"
@@ -588,3 +589,46 @@ func (handler *HelmAppRestHandlerImpl) SaveHelmAppDetailsViewedTelemetryData(w h
588589
common.WriteJsonResp(w, err, nil, http.StatusOK)
589590

590591
}
592+
593+
func (handler *HelmAppRestHandlerImpl) ListHelmApplicationsForEnvironment(w http.ResponseWriter, r *http.Request) {
594+
595+
query := r.URL.Query()
596+
597+
clusterIdString := query.Get("clusterId")
598+
var (
599+
clusterId int
600+
envId int
601+
err error
602+
)
603+
604+
if len(clusterIdString) != 0 {
605+
clusterId, err = strconv.Atoi(clusterIdString)
606+
if err != nil {
607+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
608+
return
609+
}
610+
}
611+
612+
envIdString := query.Get("envId")
613+
if len(envIdString) != 0 {
614+
envId, err = strconv.Atoi(envIdString)
615+
if err != nil {
616+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
617+
return
618+
}
619+
}
620+
621+
token := r.Header.Get("token")
622+
if ok := handler.enforcer.Enforce(token, casbin.ResourceGlobal, casbin.ActionGet, "*"); !ok {
623+
common.WriteJsonResp(w, errors.New("unauthorized"), nil, http.StatusForbidden)
624+
return
625+
}
626+
releaseList, err := handler.helmAppService.ListHelmApplicationsForClusterOrEnv(r.Context(), clusterId, envId)
627+
if err != nil {
628+
handler.logger.Errorw("error in fetching helm release for given env", "err", err)
629+
common.WriteJsonResp(w, err, "error in fetching helm release", http.StatusInternalServerError)
630+
return
631+
}
632+
common.WriteJsonResp(w, nil, releaseList, http.StatusOK)
633+
return
634+
}

api/helm-app/HelmAppRouter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func (impl *HelmAppRouterImpl) InitAppListRouter(helmRouter *mux.Router) {
4545
helmRouter.Path("/hibernate").Queries("appType", "{appType}").HandlerFunc(impl.helmAppRestHandler.Hibernate).Methods("POST")
4646
helmRouter.Path("/unhibernate").Queries("appType", "{appType}").HandlerFunc(impl.helmAppRestHandler.UnHibernate).Methods("POST")
4747

48+
helmRouter.Path("/external-helm-release").
49+
HandlerFunc(impl.helmAppRestHandler.ListHelmApplicationsForEnvironment).
50+
Methods("GET")
51+
4852
// GetReleaseInfo used only for external apps
4953
helmRouter.Path("/release-info").Queries("appId", "{appId}").
5054
HandlerFunc(impl.helmAppRestHandler.GetReleaseInfo).Methods("GET")

api/helm-app/bean/bean.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
SOURCE_DEVTRON_APP SourceAppType = "devtron-app"
2727
SOURCE_HELM_APP SourceAppType = "helm-app"
2828
SOURCE_EXTERNAL_HELM_APP SourceAppType = "external-helm-app"
29+
SOURCE_LINKED_HELM_APP SourceAppType = "linked-helm-app"
2930
SOURCE_UNKNOWN SourceAppType = "unknown"
3031
ErrReleaseNotFound string = "release: not found"
3132
)

api/helm-app/gRPC/applicationClient.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type HelmAppClient interface {
5252
InstallReleaseWithCustomChart(ctx context.Context, in *HelmInstallCustomRequest) (*HelmInstallCustomResponse, error)
5353
GetNotes(ctx context.Context, request *InstallReleaseRequest) (*ChartNotesResponse, error)
5454
ValidateOCIRegistry(ctx context.Context, OCIRegistryRequest *RegistryCredential) (*OCIRegistryResponse, error)
55+
GetReleaseDetails(ctx context.Context, in *ReleaseIdentifier) (*DeployedAppDetail, error)
5556
GetExternalFluxAppDetail(ctx context.Context, in *FluxAppDetailRequest) (*FluxAppDetail, error)
5657
}
5758

@@ -395,6 +396,19 @@ func (impl *HelmAppClientImpl) ListFluxApplication(ctx context.Context, req *App
395396
}
396397
return stream, nil
397398
}
399+
400+
func (impl *HelmAppClientImpl) GetReleaseDetails(ctx context.Context, in *ReleaseIdentifier) (*DeployedAppDetail, error) {
401+
applicationClient, err := impl.getApplicationClient()
402+
if err != nil {
403+
return nil, err
404+
}
405+
response, err := applicationClient.GetReleaseDetails(ctx, in)
406+
if err != nil {
407+
return nil, err
408+
}
409+
return response, nil
410+
}
411+
398412
func (impl *HelmAppClientImpl) GetExternalFluxAppDetail(ctx context.Context, in *FluxAppDetailRequest) (*FluxAppDetail, error) {
399413
applicationClient, err := impl.getApplicationClient()
400414
if err != nil {

0 commit comments

Comments
 (0)