Skip to content

Commit d38a408

Browse files
kartik-579prakash100198RajeevRanjan27prkhrkatashokdevtron
authored
feat: Argo listing change (#5768)
* migration number changes (#5692) * refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696) * fix: Decode secret fix on add update oss (#5695) * ValidateEncodedDataByDecoding in case add or update secret * wire fix from main * minor refactor * comment * saving pco concurrency case handled (#5688) * fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701) * script for pipelineStageStepVariable, making input value and default_value text from varchar255 * erro log fix * fix: ea fixes for helm app (#5708) * added the ea apps entry app table * resolved the ea mode multiple rows error during configuration of app * modified the ea dockerfile in ca-certificates cmd * uncommented the code and left the ea helm app making way untouched * remodified the dockerfile as previous state * modified the docker file ea mode * dockerfile exit code 100 due to ap install alternative in ea mode dockerfile * execute make after main merge * modified changes in dockerfile ea mode * resolved comments after first level review * Revert "fix: ea fixes for helm app (#5708)" (#5713) This reverts commit 3e31f49. * fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712) * SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation * minor refactor * minor refactor * migration syn with ent (#5718) * doc: Edit Deployment Chart Schema (#5735) * Edit Deployment Chart Schema * Fixes * PM + CO Feedback Incorporated * doc: Redirection of old entry in gitbook.yaml (#5738) * Edit Deployment Chart Schema * Fixes * PM + CO Feedback Incorporated * Redirected Old Entry * docs: added Documentation for Air-Gapped Installation (#5360) * added docs for air-gapped-installation * added all the images in 7.0.0 * modified yq command in the docs * added an entry in summary.md * added installation commands * modified statements * modified variable name * added steps to navigation * added the latest oss chart images * added a note for docker * Added Intro + Proofreading + Structuring * Other fixes * Lang fix * added docs for ea-mode only * modified lang * Update install-devtron-in-airgapped-environment.md Changed h3 header to fit the ToC on the RHS * added changes * modified changes --------- Co-authored-by: Badal Kumar Prusty <[email protected]> Co-authored-by: ashokdevtron <[email protected]> * feat: Env description handling (#5744) * env description handling added * license handling * misc: Main sync rc - branch update (#5753) * added config sql script (#5681) * feat: CVE severity categorisation and scan result listing API enhancements (#5617) * feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support * fix: query fix for appName sort or envName sort * fix: sql script number change * fix: minor changes * fix: review fix * fix: remove dml on cve_store and handle it in code handling this versioning * fix: review comments * fix: update script numbers * fix: minor fix * feat: casbin deny policy sql scripts (#5677) * system controller scripts * script additions * sql cript update * sql script number chnage * feat: Config diff phase 2 oss (#5488) * story(configDiffView) : open api spec * story(configDiffView) : open api spec updated * story(configDiffView) : open api spec updated for error state * story(configDiffView) : WIP * story(configDiffView) : WIP "some code changed" * story(configDiffView) : support for names added * story(configDiffView) : iota removed * story(configDiffView) : pg no rows handled * story(configDiffView) : spelling check * story(configDiffView) : code review comment resolved * story(configDiffView) : env id added * story(configDiffView) : intersection added * story(configDiffView) : comments removed * story(configDiffView) : code review comment resolved * story(configDiffView) : comment removed * story(configDiffView) : CMCSNames DTO moved * story(configDiffView) : null case handled * story(configDiffView) : logger added * story(configDiffView) : code refactored * story(configDiffView) : code refactored v2 * story(configDiffView) : spec updated * story(configDiffView) : code refactored * story(configDiffView) : config names * main sync * overridden and global flag introduced in config diff autocomplete api * ent sync * get config data in resthandler * new api for showing all config data in config/data :- Service func -> GetAllConfigData * using a single key instead of global and overridden key in config/autocomplete api * ConfigState made string instead of int * not sending inheriting in case base config * code review comment incorporation * ent sync * code review comment incorp -1 * code review comment incorp -2 * code review comment incorp -3 * small fix in plugin * migration number changes (#5692) * main sync * minor fix * refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696) * fix: Decode secret fix on add update oss (#5695) * ValidateEncodedDataByDecoding in case add or update secret * wire fix from main * minor refactor * comment * saving pco concurrency case handled (#5688) * fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701) * script for pipelineStageStepVariable, making input value and default_value text from varchar255 * erro log fix * scipt number change --------- Co-authored-by: adi6859 <[email protected]> Co-authored-by: Vikram Singh <[email protected]> * fix: Helm apps entries in Ea mode (#5652) * added the ea apps entry app table * resolved the ea mode multiple rows error during configuration of app * modified the ea dockerfile in ca-certificates cmd * uncommented the code and left the ea helm app making way untouched * remodified the dockerfile as previous state * modified the docker file ea mode * dockerfile exit code 100 due to ap install alternative in ea mode dockerfile * execute make after main merge * modified changes in dockerfile ea mode * resolved comments after first level review * executed make after merging with develop branch * feat: refactoring deployment app name usage (#5702) * removing hard coded deployment app name * removing %s-%s usage * wip: query change for enterprise * wip * wip * wip * adding release mode in deployment config * wip: release changes * left join on pco and artifact * handling empty release mode - backward compatibility * fixing panic * migration number changes (#5692) * refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696) * fix: Decode secret fix on add update oss (#5695) * ValidateEncodedDataByDecoding in case add or update secret * wire fix from main * minor refactor * comment * saving pco concurrency case handled (#5688) * migration updated * main merge and migration script updated * wip * review changes * fix sql no --------- Co-authored-by: Prakash <[email protected]> * migration syn with ent (#5719) * fix: group image vulnerabilities by base/os image (#5680) * feat: add support for app and env sorting in scan list api and add medium, high and unknown severity support * fix: query fix for appName sort or envName sort * fix: sql script number change * fix: minor changes * fix: review fix * fix: remove dml on cve_store and handle it in code handling this versioning * fix: review comments * feat: storing target,class and type values in imageScanExecutionResults * feat: add sql script * feat: add sql script * fix: add new columns * fix: update script numbers * fix: correct down script * fix: minor fix * chore: script number update * fix: remove sql script (#5727) * Revert "fix: Helm apps entries in Ea mode (#5652)" (#5733) This reverts commit f1aa1fc. * chore: custom argo-workflow dependency (#5731) * bumped github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.10 * migration number changes (#5692) * refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696) * fix: Decode secret fix on add update oss (#5695) * ValidateEncodedDataByDecoding in case add or update secret * wire fix from main * minor refactor * comment * saving pco concurrency case handled (#5688) * fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701) * script for pipelineStageStepVariable, making input value and default_value text from varchar255 * erro log fix * fix: ea fixes for helm app (#5708) * added the ea apps entry app table * resolved the ea mode multiple rows error during configuration of app * modified the ea dockerfile in ca-certificates cmd * uncommented the code and left the ea helm app making way untouched * remodified the dockerfile as previous state * modified the docker file ea mode * dockerfile exit code 100 due to ap install alternative in ea mode dockerfile * execute make after main merge * modified changes in dockerfile ea mode * resolved comments after first level review * Revert "fix: ea fixes for helm app (#5708)" (#5713) This reverts commit 3e31f49. * fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712) * SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation * minor refactor * minor refactor * migration syn with ent (#5718) * reverted main branch changes * reverted main branch changes --------- Co-authored-by: Prakash <[email protected]> Co-authored-by: Rajeev Ranjan <[email protected]> Co-authored-by: prakhar katiyar <[email protected]> * chore: fix go.sum file (#5734) * misc: Main sync develop (#5737) * migration number changes (#5692) * refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696) * fix: Decode secret fix on add update oss (#5695) * ValidateEncodedDataByDecoding in case add or update secret * wire fix from main * minor refactor * comment * saving pco concurrency case handled (#5688) * fix: script for pipelineStageStepVariable, making input value and default_value text from varchar255 (#5701) * script for pipelineStageStepVariable, making input value and default_value text from varchar255 * erro log fix * fix: ea fixes for helm app (#5708) * added the ea apps entry app table * resolved the ea mode multiple rows error during configuration of app * modified the ea dockerfile in ca-certificates cmd * uncommented the code and left the ea helm app making way untouched * remodified the dockerfile as previous state * modified the docker file ea mode * dockerfile exit code 100 due to ap install alternative in ea mode dockerfile * execute make after main merge * modified changes in dockerfile ea mode * resolved comments after first level review * Revert "fix: ea fixes for helm app (#5708)" (#5713) This reverts commit 3e31f49. * fix: SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation (#5712) * SkipCiBuildCachePushPull code incorporated with minor refac in handle runtime params validation * minor refactor * minor refactor * migration syn with ent (#5718) --------- Co-authored-by: Prakash <[email protected]> Co-authored-by: Rajeev Ranjan <[email protected]> Co-authored-by: prakhar katiyar <[email protected]> * fix: Validate config cm cs (#5750) * validateConfigRequest before CMGlobalAddUpdate and CSGlobalAddUpdate * checkIfConfigDataAlreadyExist --------- Co-authored-by: ayu-devtron <[email protected]> Co-authored-by: Vikram Singh <[email protected]> Co-authored-by: Gireesh Naidu <[email protected]> Co-authored-by: Shivam Nagar <[email protected]> Co-authored-by: Prakash <[email protected]> Co-authored-by: adi6859 <[email protected]> Co-authored-by: Rajeev Ranjan <[email protected]> Co-authored-by: iamayushm <[email protected]> Co-authored-by: prakhar katiyar <[email protected]> Co-authored-by: Asutosh Das <[email protected]> Co-authored-by: Vikram <[email protected]> Co-authored-by: Prakarsh <[email protected]> * doc: Update prerequisites of code-scan (#5625) * Update prerequisites of code-scan * Hyperlinked the Vulnerability scanning doc --------- Co-authored-by: ashokdevtron <[email protected]> * fix: ci patch rbac for branch update (#5759) * feat: Added basic auth support for servicemonitor (#5761) * Added support for basic auth in servicemonitor * Added support for namespace selector and custom matchLabels * Fixed indentations * fix: Bitnami chart repo tls issue (#5740) * bitnami_chart_fix * Rename 278_bitnami_chart_fix.down.sql to 282_bitnami_chart_fix.down.sql * Rename 278_bitnami_chart_fix.up.sql to 282_bitnami_chart_fix.up.sql --------- Co-authored-by: Pawan Mehta <[email protected]> * doc: Cosign plugin doc (#5665) * doc for cosign plugin * edits in task name * updates in intro and other fixes. * Attached link to Cosign GitHub repo * Hyperlink fixes --------- Co-authored-by: ashokdevtron <[email protected]> * fix: check rbac on env if envName is present (#5765) * admin check fix in config draft * minor fix * doc: CraneCopy plugin doc (#5658) * doc for * edits in task name * spelling correction * Updated password --------- Co-authored-by: ashokdevtron <[email protected]> * doc: Devtron CD Trigger Plugin doc (#5747) * devtron-cd-trigger plugin doc * minor update * Proofreading done * Update devtron-cd-trigger.md * Removed unwanted phrase * Changed wording * Changed plurality * Updated devtron token --------- Co-authored-by: ashokdevtron <[email protected]> * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * doc: DockerSlim plugin doc (#5660) * doc for DockerSlim plugin * Updated Docker-Slim to DockerSlim * Minor fixes * url update * Fixes in url --------- Co-authored-by: ashokdevtron <[email protected]> * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * doc: Devtron Job Trigger Plugin doc (#5742) * devtron-job-trigger plugin doc * summary updated * Updated input variable description * token value updated --------- Co-authored-by: ashokdevtron <[email protected]> * fix: scan tool active check removed (#5771) * scan tool active check removed * query fix * feat: Docker pull env driven (#5767) * useDockerApiToGetDigest menv driven flag to control pulling image either using docker pull or docker API * UseAppDockerConfigForPrivateRegistries in workflow request * revert * revert * fix: panic handlings and argocd app delete stuck in partial stage (#5770) * fix: panic handlings * fix: false positive matrics on gitOps failures * fix: for GetConfigForHelmApps err: pg no row * feat: plugin creation support (#5630) * wip: new plugin creation api and min plugin api with only shared plugin list * wip: create new plugin version code * wip:plugin type SHARED by default * wip:find plugin either by identifier or by id while creating a new version of existing plugin * wip: create new plugin tag logic improved * wip: optimize GetAllFilteredPluginParentMetadata query * wip: create plugin tag new flow * wip: minor fix * wip: minor fix * wip: minor fix * wip: newTagsPresent -> areNewTagsPresent * wip: icon is not mandatory code incorporated * wip:minor refactoring * wip: prevent duplicate version from being created and save tags relation only when * wip: minor fix * wip: details api, get all plugin data or non * wip: code review incorp part -1 * wip: code review incorp part -2 * wip: code review incorp part -3 * wip: remove code duplication * wip: hardcode isExposed to true * wip: hardcode StepType= inline * wip: set default VariableStepIndex= 1 * wip * Revert "feat: plugin creation support (#5630)" (#5778) This reverts commit 4296366. * updated common lib to 761a56e2b * wip * fix: unimplemented cluster cron service (#5781) * fix: sql injection fixes (#5783) * sql injection fixes * query param init fix * doc: Vulnerability Scanning Plugin doc (#5722) * vulnerability scanning plugin doc * summary.md added * docs: Jira plugins doc (Validator + Updater) (#5709) * Docs of Jira Plugins - Validator and Updater * Added Index Links * Additional Proofreading * add basic auth and tls for sm (#5789) * reverted common lib change * updated handling for getting restConfig through custom transport commonm method * docs: added commands enable ingress during helm installation (#5794) * added commands emable ingress during helm installation * modified commands * improved statement * removed unrequired lines --------- Co-authored-by: Badal Kumar Prusty <[email protected]> * Revamped + Restructured Ingress Setup Doc (#5798) * modifying route (#5799) Co-authored-by: Badal Kumar Prusty <[email protected]> * fix: cron status update refactoring (#5790) Co-authored-by: Nishant <[email protected]> * docs: modified the anchorlink in ingress.md (#5800) * modifying route * modified the anchorlink --------- Co-authored-by: Badal Kumar Prusty <[email protected]> * query param split (#5801) * fix: upgraded to /argo-cd/v2 v2.9.21 (#5758) * upgraded to /argo-cd/v2 v2.9.21 * argocd vendor files added * sync with common-lib * fix: Ea rbac fixes (#5813) * app found using display or app name * single query optimization * display name handling for new apps --------- Co-authored-by: kartik-579 <[email protected]> --------- Co-authored-by: Prakash <[email protected]> Co-authored-by: Rajeev Ranjan <[email protected]> Co-authored-by: prakhar katiyar <[email protected]> Co-authored-by: ashokdevtron <[email protected]> Co-authored-by: Badal Kumar <[email protected]> Co-authored-by: Badal Kumar Prusty <[email protected]> Co-authored-by: kripanshdevtron <[email protected]> Co-authored-by: ayu-devtron <[email protected]> Co-authored-by: Vikram Singh <[email protected]> Co-authored-by: Gireesh Naidu <[email protected]> Co-authored-by: Shivam Nagar <[email protected]> Co-authored-by: adi6859 <[email protected]> Co-authored-by: iamayushm <[email protected]> Co-authored-by: Asutosh Das <[email protected]> Co-authored-by: Vikram <[email protected]> Co-authored-by: Prakarsh <[email protected]> Co-authored-by: Bhushan Nemade <[email protected]> Co-authored-by: Pawan Mehta <[email protected]> Co-authored-by: akshatsinha007 <[email protected]> Co-authored-by: Nishant <[email protected]>
1 parent 61bf950 commit d38a408

File tree

12 files changed

+575
-483
lines changed

12 files changed

+575
-483
lines changed

api/argoApplication/ArgoApplicationRestHandler.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"errors"
2121
"github.com/devtron-labs/devtron/api/restHandler/common"
2222
"github.com/devtron-labs/devtron/pkg/argoApplication"
23+
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
2324
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
2425
"go.uber.org/zap"
2526
"net/http"
@@ -34,14 +35,16 @@ type ArgoApplicationRestHandler interface {
3435

3536
type ArgoApplicationRestHandlerImpl struct {
3637
argoApplicationService argoApplication.ArgoApplicationService
38+
readService read.ArgoApplicationReadService
3739
logger *zap.SugaredLogger
3840
enforcer casbin.Enforcer
3941
}
4042

4143
func NewArgoApplicationRestHandlerImpl(argoApplicationService argoApplication.ArgoApplicationService,
42-
logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
44+
readService read.ArgoApplicationReadService, logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
4345
return &ArgoApplicationRestHandlerImpl{
4446
argoApplicationService: argoApplicationService,
47+
readService: readService,
4548
logger: logger,
4649
enforcer: enforcer,
4750
}
@@ -101,9 +104,9 @@ func (handler *ArgoApplicationRestHandlerImpl) GetApplicationDetail(w http.Respo
101104
return
102105
}
103106
}
104-
resp, err := handler.argoApplicationService.GetAppDetail(resourceName, namespace, clusterId)
107+
resp, err := handler.readService.GetAppDetail(resourceName, namespace, clusterId)
105108
if err != nil {
106-
handler.logger.Errorw("error in listing all argo applications", "err", err, "resourceName", resourceName, "clusterId", clusterId)
109+
handler.logger.Errorw("error in getting argo application app detail", "err", err, "resourceName", resourceName, "clusterId", clusterId)
107110
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
108111
return
109112
}

api/argoApplication/wire_argoApplication.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ package argoApplication
1818

1919
import (
2020
"github.com/devtron-labs/devtron/pkg/argoApplication"
21+
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
2122
"github.com/google/wire"
2223
)
2324

2425
var ArgoApplicationWireSet = wire.NewSet(
26+
read.NewArgoApplicationReadServiceImpl,
27+
wire.Bind(new(read.ArgoApplicationReadService), new(*read.ArgoApplicationReadServiceImpl)),
28+
2529
argoApplication.NewArgoApplicationServiceImpl,
2630
wire.Bind(new(argoApplication.ArgoApplicationService), new(*argoApplication.ArgoApplicationServiceImpl)),
2731

api/helm-app/HelmAppRestHandler.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service"
2626
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/EAMode"
2727
"github.com/devtron-labs/devtron/pkg/argoApplication"
28+
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
2829
clientErrors "github.com/devtron-labs/devtron/pkg/errors"
2930
"github.com/devtron-labs/devtron/pkg/fluxApplication"
3031
bean2 "github.com/devtron-labs/devtron/pkg/k8s/application/bean"
@@ -232,7 +233,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationHibernate(r *http.Re
232233
return handler.fluxApplication.HibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
233234
}
234235
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
235-
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
236+
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
236237
if err != nil {
237238
return nil, err
238239
}
@@ -316,7 +317,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationUnHibernate(r *http.
316317
return handler.fluxApplication.UnHibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
317318
}
318319
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationUnHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
319-
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
320+
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
320321
if err != nil {
321322
return nil, err
322323
}

api/k8s/application/k8sApplicationRestHandler.go

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ import (
3333
client "github.com/devtron-labs/devtron/api/helm-app/service"
3434
"github.com/devtron-labs/devtron/api/restHandler/common"
3535
util2 "github.com/devtron-labs/devtron/internal/util"
36-
"github.com/devtron-labs/devtron/pkg/argoApplication"
36+
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
37+
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
3738
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
3839
"github.com/devtron-labs/devtron/pkg/auth/user"
3940
"github.com/devtron-labs/devtron/pkg/cluster"
@@ -81,39 +82,39 @@ type K8sApplicationRestHandler interface {
8182
}
8283

8384
type K8sApplicationRestHandlerImpl struct {
84-
logger *zap.SugaredLogger
85-
k8sApplicationService application2.K8sApplicationService
86-
pump connector.Pump
87-
terminalSessionHandler terminal.TerminalSessionHandler
88-
enforcer casbin.Enforcer
89-
validator *validator.Validate
90-
enforcerUtil rbac.EnforcerUtil
91-
enforcerUtilHelm rbac.EnforcerUtilHelm
92-
helmAppService client.HelmAppService
93-
userService user.UserService
94-
k8sCommonService k8s.K8sCommonService
95-
terminalEnvVariables *util.TerminalEnvVariables
96-
fluxAppService fluxApplication.FluxApplicationService
97-
argoApplication argoApplication.ArgoApplicationService
85+
logger *zap.SugaredLogger
86+
k8sApplicationService application2.K8sApplicationService
87+
pump connector.Pump
88+
terminalSessionHandler terminal.TerminalSessionHandler
89+
enforcer casbin.Enforcer
90+
validator *validator.Validate
91+
enforcerUtil rbac.EnforcerUtil
92+
enforcerUtilHelm rbac.EnforcerUtilHelm
93+
helmAppService client.HelmAppService
94+
userService user.UserService
95+
k8sCommonService k8s.K8sCommonService
96+
terminalEnvVariables *util.TerminalEnvVariables
97+
fluxAppService fluxApplication.FluxApplicationService
98+
argoApplicationReadService read.ArgoApplicationReadService
9899
}
99100

100-
func NewK8sApplicationRestHandlerImpl(logger *zap.SugaredLogger, k8sApplicationService application2.K8sApplicationService, pump connector.Pump, terminalSessionHandler terminal.TerminalSessionHandler, enforcer casbin.Enforcer, enforcerUtilHelm rbac.EnforcerUtilHelm, enforcerUtil rbac.EnforcerUtil, helmAppService client.HelmAppService, userService user.UserService, k8sCommonService k8s.K8sCommonService, validator *validator.Validate, envVariables *util.EnvironmentVariables, fluxAppService fluxApplication.FluxApplicationService, argoApplication argoApplication.ArgoApplicationService,
101+
func NewK8sApplicationRestHandlerImpl(logger *zap.SugaredLogger, k8sApplicationService application2.K8sApplicationService, pump connector.Pump, terminalSessionHandler terminal.TerminalSessionHandler, enforcer casbin.Enforcer, enforcerUtilHelm rbac.EnforcerUtilHelm, enforcerUtil rbac.EnforcerUtil, helmAppService client.HelmAppService, userService user.UserService, k8sCommonService k8s.K8sCommonService, validator *validator.Validate, envVariables *util.EnvironmentVariables, fluxAppService fluxApplication.FluxApplicationService, argoApplicationReadService read.ArgoApplicationReadService,
101102
) *K8sApplicationRestHandlerImpl {
102103
return &K8sApplicationRestHandlerImpl{
103-
logger: logger,
104-
k8sApplicationService: k8sApplicationService,
105-
pump: pump,
106-
terminalSessionHandler: terminalSessionHandler,
107-
enforcer: enforcer,
108-
validator: validator,
109-
enforcerUtilHelm: enforcerUtilHelm,
110-
enforcerUtil: enforcerUtil,
111-
helmAppService: helmAppService,
112-
userService: userService,
113-
k8sCommonService: k8sCommonService,
114-
terminalEnvVariables: envVariables.TerminalEnvVariables,
115-
fluxAppService: fluxAppService,
116-
argoApplication: argoApplication,
104+
logger: logger,
105+
k8sApplicationService: k8sApplicationService,
106+
pump: pump,
107+
terminalSessionHandler: terminalSessionHandler,
108+
enforcer: enforcer,
109+
validator: validator,
110+
enforcerUtilHelm: enforcerUtilHelm,
111+
enforcerUtil: enforcerUtil,
112+
helmAppService: helmAppService,
113+
userService: userService,
114+
k8sCommonService: k8sCommonService,
115+
terminalEnvVariables: envVariables.TerminalEnvVariables,
116+
fluxAppService: fluxAppService,
117+
argoApplicationReadService: argoApplicationReadService,
117118
}
118119
}
119120

@@ -289,7 +290,7 @@ func (handler *K8sApplicationRestHandlerImpl) GetHostUrlsByBatch(w http.Response
289290
resourceTreeResponse = appDetail.ResourceTreeResponse
290291

291292
} else if appType == bean2.ArgoAppType {
292-
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(appIdString)
293+
appIdentifier, err := helper.DecodeExternalArgoAppId(appIdString)
293294
if err != nil {
294295
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
295296
return
@@ -301,7 +302,7 @@ func (handler *K8sApplicationRestHandlerImpl) GetHostUrlsByBatch(w http.Response
301302
}
302303
//RBAC enforcer Ends
303304

304-
appDetail, err := handler.argoApplication.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
305+
appDetail, err := handler.argoApplicationReadService.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
305306
if err != nil {
306307
apiError := clientErrors.ConvertToApiError(err)
307308
if apiError != nil {
@@ -721,12 +722,12 @@ func (handler *K8sApplicationRestHandlerImpl) requestValidationAndRBAC(w http.Re
721722
}
722723
//RBAC enforcer ends here
723724
} else if request.AppType == bean2.ArgoAppType && request.ExternalArgoApplicationName != "" {
724-
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
725+
appIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
725726
if err != nil {
726727
handler.logger.Errorw(bean2.AppIdDecodingError, "err", err, "appIdentifier", request.AppIdentifier)
727728
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
728729
}
729-
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
730+
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
730731
if err != nil || !valid {
731732
handler.logger.Errorw("error in validating resource request", "err", err)
732733
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
@@ -1145,14 +1146,14 @@ func (handler *K8sApplicationRestHandlerImpl) verifyRbacForAppRequests(token str
11451146
envObject := ""
11461147
switch request.AppType {
11471148
case bean2.ArgoAppType:
1148-
argoAppIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
1149+
argoAppIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
11491150
if err != nil {
11501151
handler.logger.Errorw("error in decoding appId", "err", err, "appId", request.AppId)
11511152
return false, err
11521153
}
11531154
request.ClusterId = argoAppIdentifier.ClusterId
11541155
request.ExternalArgoApplicationName = argoAppIdentifier.AppName
1155-
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
1156+
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
11561157
if err != nil || !valid {
11571158
handler.logger.Errorw("error in validating resource request", "err", err)
11581159
return false, err

cmd/external-app/wire_gen.go

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)