Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Argo listing change #5768

Merged
merged 87 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
779e913
migration number changes (#5692)
prakash100198 Aug 15, 2024
4f04d6b
refrain from checkin autoscalingCheckBeforeTrigger for virt clus (#5696)
prakash100198 Aug 20, 2024
2e58e77
fix: Decode secret fix on add update oss (#5695)
prakash100198 Aug 20, 2024
bf23515
saving pco concurrency case handled (#5688)
prakash100198 Aug 20, 2024
694831c
fix: script for pipelineStageStepVariable, making input value and def…
prakash100198 Aug 21, 2024
3e31f49
fix: ea fixes for helm app (#5708)
RajeevRanjan27 Aug 21, 2024
8de88d7
Revert "fix: ea fixes for helm app (#5708)" (#5713)
RajeevRanjan27 Aug 22, 2024
378c2d9
fix: SkipCiBuildCachePushPull code incorporated with minor refac in h…
prakash100198 Aug 22, 2024
827608f
migration syn with ent (#5718)
prkhrkat Aug 23, 2024
5f43eb2
doc: Edit Deployment Chart Schema (#5735)
ashokdevtron Aug 23, 2024
16d01d6
doc: Redirection of old entry in gitbook.yaml (#5738)
ashokdevtron Aug 23, 2024
d816dee
docs: added Documentation for Air-Gapped Installation (#5360)
badal773 Aug 23, 2024
26784d5
feat: Env description handling (#5744)
kripanshdevtron Aug 27, 2024
e677fbd
misc: Main sync rc - branch update (#5753)
kartik-579 Aug 28, 2024
8a61bac
doc: Update prerequisites of code-scan (#5625)
bhushan-nemade-dt Aug 28, 2024
6da544f
fix: ci patch rbac for branch update (#5759)
Ash-exp Aug 28, 2024
09946c2
feat: Added basic auth support for servicemonitor (#5761)
pawan-mehta-dt Aug 29, 2024
80f0758
fix: Bitnami chart repo tls issue (#5740)
akshatsinha007 Aug 29, 2024
7ee4a32
doc: Cosign plugin doc (#5665)
bhushan-nemade-dt Aug 29, 2024
99d10f5
fix: check rbac on env if envName is present (#5765)
prakash100198 Aug 29, 2024
f1a50b1
doc: CraneCopy plugin doc (#5658)
bhushan-nemade-dt Aug 30, 2024
3ef2b96
doc: Devtron CD Trigger Plugin doc (#5747)
bhushan-nemade-dt Aug 30, 2024
74ae3e4
wip
kartik-579 Aug 30, 2024
0f90450
wip
kartik-579 Aug 30, 2024
ef838ae
wip
kartik-579 Aug 30, 2024
88e0898
wip
kartik-579 Aug 30, 2024
974e866
wip
kartik-579 Aug 30, 2024
8a1f5df
wip
kartik-579 Aug 30, 2024
df34a81
wip
kartik-579 Aug 30, 2024
7200791
wip
kartik-579 Aug 30, 2024
0ce7dc2
wip
kartik-579 Aug 30, 2024
ea65a16
wip
kartik-579 Aug 30, 2024
9346f79
wip
kartik-579 Aug 30, 2024
22fbb19
wip
kartik-579 Aug 30, 2024
a1e4c0f
wip
kartik-579 Aug 30, 2024
9844fb0
wip
kartik-579 Aug 30, 2024
b78f4d1
wip
kartik-579 Aug 30, 2024
3888a41
doc: DockerSlim plugin doc (#5660)
bhushan-nemade-dt Aug 30, 2024
5aa82cc
wip
kartik-579 Aug 30, 2024
bdcf32c
wip
kartik-579 Aug 30, 2024
e502b1b
wip
kartik-579 Aug 30, 2024
ccb8582
wip
kartik-579 Aug 30, 2024
fbb6f10
wip
kartik-579 Aug 30, 2024
b3ee0e2
wip
kartik-579 Aug 30, 2024
2e68a3f
wip
kartik-579 Aug 30, 2024
dcbc025
wip
kartik-579 Aug 30, 2024
0532f3e
wip
kartik-579 Aug 30, 2024
1108ce0
wip
kartik-579 Aug 30, 2024
431abda
wip
kartik-579 Aug 30, 2024
3d02002
wip
kartik-579 Aug 30, 2024
a876c0c
wip
kartik-579 Aug 30, 2024
8e8c4f8
wip
kartik-579 Aug 30, 2024
c7f1820
wip
kartik-579 Aug 30, 2024
1725e8f
wip
kartik-579 Aug 30, 2024
6118ae9
wip
kartik-579 Aug 30, 2024
1718cca
wip
kartik-579 Aug 30, 2024
65bfc01
wip
kartik-579 Aug 30, 2024
a625e7e
doc: Devtron Job Trigger Plugin doc (#5742)
bhushan-nemade-dt Aug 30, 2024
ff89a26
fix: scan tool active check removed (#5771)
kripanshdevtron Aug 30, 2024
5170040
feat: Docker pull env driven (#5767)
prakash100198 Aug 30, 2024
c66ccf5
fix: panic handlings and argocd app delete stuck in partial stage (#5…
Ash-exp Aug 30, 2024
4296366
feat: plugin creation support (#5630)
prakash100198 Sep 2, 2024
51fbba8
wip
kartik-579 Sep 2, 2024
278210d
Merge branch 'main' into argo-listing-change
kartik-579 Sep 2, 2024
47843d9
Revert "feat: plugin creation support (#5630)" (#5778)
prakash100198 Sep 2, 2024
42d95ce
updated common lib to 761a56e2b
kartik-579 Sep 2, 2024
e3efcb1
wip
kartik-579 Sep 2, 2024
4209b32
Merge branch 'main' into argo-listing-change
kartik-579 Sep 2, 2024
fd90dfb
fix: unimplemented cluster cron service (#5781)
Ash-exp Sep 2, 2024
1540271
fix: sql injection fixes (#5783)
kripanshdevtron Sep 2, 2024
ba02845
doc: Vulnerability Scanning Plugin doc (#5722)
bhushan-nemade-dt Sep 3, 2024
02f4a1b
docs: Jira plugins doc (Validator + Updater) (#5709)
ashokdevtron Sep 3, 2024
a6a2ae2
add basic auth and tls for sm (#5789)
pawan-mehta-dt Sep 3, 2024
0613064
Merge branch 'main' into argo-listing-change
kartik-579 Sep 4, 2024
6eb0cc1
reverted common lib change
kartik-579 Sep 4, 2024
3e68996
updated handling for getting restConfig through custom transport comm…
kartik-579 Sep 4, 2024
654ba93
docs: added commands enable ingress during helm installation (#5794)
badal773 Sep 4, 2024
0e16daf
Revamped + Restructured Ingress Setup Doc (#5798)
ashokdevtron Sep 4, 2024
d4bd272
modifying route (#5799)
badal773 Sep 4, 2024
43ba232
fix: cron status update refactoring (#5790)
Ash-exp Sep 4, 2024
be9d553
docs: modified the anchorlink in ingress.md (#5800)
badal773 Sep 4, 2024
1e0af22
query param split (#5801)
Shivam-nagar23 Sep 4, 2024
8f92d3f
fix: upgraded to /argo-cd/v2 v2.9.21 (#5758)
prkhrkat Sep 5, 2024
bd51187
fix: Ea rbac fixes (#5813)
kripanshdevtron Sep 9, 2024
71facbe
Merge branch 'main' into argo-listing-change
kartik-579 Sep 9, 2024
0ab6af4
Merge branch 'develop' into argo-listing-change
kartik-579 Sep 9, 2024
7f80394
Merge branch 'develop' into argo-listing-change
kartik-579 Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions api/argoApplication/ArgoApplicationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"go.uber.org/zap"
"net/http"
Expand All @@ -34,14 +35,16 @@ type ArgoApplicationRestHandler interface {

type ArgoApplicationRestHandlerImpl struct {
argoApplicationService argoApplication.ArgoApplicationService
readService read.ArgoApplicationReadService
logger *zap.SugaredLogger
enforcer casbin.Enforcer
}

func NewArgoApplicationRestHandlerImpl(argoApplicationService argoApplication.ArgoApplicationService,
logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
readService read.ArgoApplicationReadService, logger *zap.SugaredLogger, enforcer casbin.Enforcer) *ArgoApplicationRestHandlerImpl {
return &ArgoApplicationRestHandlerImpl{
argoApplicationService: argoApplicationService,
readService: readService,
logger: logger,
enforcer: enforcer,
}
Expand Down Expand Up @@ -101,9 +104,9 @@ func (handler *ArgoApplicationRestHandlerImpl) GetApplicationDetail(w http.Respo
return
}
}
resp, err := handler.argoApplicationService.GetAppDetail(resourceName, namespace, clusterId)
resp, err := handler.readService.GetAppDetail(resourceName, namespace, clusterId)
if err != nil {
handler.logger.Errorw("error in listing all argo applications", "err", err, "resourceName", resourceName, "clusterId", clusterId)
handler.logger.Errorw("error in getting argo application app detail", "err", err, "resourceName", resourceName, "clusterId", clusterId)
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
return
}
Expand Down
4 changes: 4 additions & 0 deletions api/argoApplication/wire_argoApplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ package argoApplication

import (
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/google/wire"
)

var ArgoApplicationWireSet = wire.NewSet(
read.NewArgoApplicationReadServiceImpl,
wire.Bind(new(read.ArgoApplicationReadService), new(*read.ArgoApplicationReadServiceImpl)),

argoApplication.NewArgoApplicationServiceImpl,
wire.Bind(new(argoApplication.ArgoApplicationService), new(*argoApplication.ArgoApplicationServiceImpl)),

Expand Down
5 changes: 3 additions & 2 deletions api/helm-app/HelmAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service"
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/service/EAMode"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
clientErrors "github.com/devtron-labs/devtron/pkg/errors"
"github.com/devtron-labs/devtron/pkg/fluxApplication"
bean2 "github.com/devtron-labs/devtron/pkg/k8s/application/bean"
Expand Down Expand Up @@ -232,7 +233,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationHibernate(r *http.Re
return handler.fluxApplication.HibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
}
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -316,7 +317,7 @@ func (handler *HelmAppRestHandlerImpl) handleFluxApplicationUnHibernate(r *http.
return handler.fluxApplication.UnHibernateFluxApplication(r.Context(), appIdentifier, hibernateRequest)
}
func (handler *HelmAppRestHandlerImpl) handleArgoApplicationUnHibernate(r *http.Request, token string, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error) {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(*hibernateRequest.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(*hibernateRequest.AppId)
if err != nil {
return nil, err
}
Expand Down
73 changes: 37 additions & 36 deletions api/k8s/application/k8sApplicationRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import (
client "github.com/devtron-labs/devtron/api/helm-app/service"
"github.com/devtron-labs/devtron/api/restHandler/common"
util2 "github.com/devtron-labs/devtron/internal/util"
"github.com/devtron-labs/devtron/pkg/argoApplication"
"github.com/devtron-labs/devtron/pkg/argoApplication/helper"
"github.com/devtron-labs/devtron/pkg/argoApplication/read"
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
"github.com/devtron-labs/devtron/pkg/auth/user"
"github.com/devtron-labs/devtron/pkg/cluster"
Expand Down Expand Up @@ -81,39 +82,39 @@ type K8sApplicationRestHandler interface {
}

type K8sApplicationRestHandlerImpl struct {
logger *zap.SugaredLogger
k8sApplicationService application2.K8sApplicationService
pump connector.Pump
terminalSessionHandler terminal.TerminalSessionHandler
enforcer casbin.Enforcer
validator *validator.Validate
enforcerUtil rbac.EnforcerUtil
enforcerUtilHelm rbac.EnforcerUtilHelm
helmAppService client.HelmAppService
userService user.UserService
k8sCommonService k8s.K8sCommonService
terminalEnvVariables *util.TerminalEnvVariables
fluxAppService fluxApplication.FluxApplicationService
argoApplication argoApplication.ArgoApplicationService
logger *zap.SugaredLogger
k8sApplicationService application2.K8sApplicationService
pump connector.Pump
terminalSessionHandler terminal.TerminalSessionHandler
enforcer casbin.Enforcer
validator *validator.Validate
enforcerUtil rbac.EnforcerUtil
enforcerUtilHelm rbac.EnforcerUtilHelm
helmAppService client.HelmAppService
userService user.UserService
k8sCommonService k8s.K8sCommonService
terminalEnvVariables *util.TerminalEnvVariables
fluxAppService fluxApplication.FluxApplicationService
argoApplicationReadService read.ArgoApplicationReadService
}

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,
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,
) *K8sApplicationRestHandlerImpl {
return &K8sApplicationRestHandlerImpl{
logger: logger,
k8sApplicationService: k8sApplicationService,
pump: pump,
terminalSessionHandler: terminalSessionHandler,
enforcer: enforcer,
validator: validator,
enforcerUtilHelm: enforcerUtilHelm,
enforcerUtil: enforcerUtil,
helmAppService: helmAppService,
userService: userService,
k8sCommonService: k8sCommonService,
terminalEnvVariables: envVariables.TerminalEnvVariables,
fluxAppService: fluxAppService,
argoApplication: argoApplication,
logger: logger,
k8sApplicationService: k8sApplicationService,
pump: pump,
terminalSessionHandler: terminalSessionHandler,
enforcer: enforcer,
validator: validator,
enforcerUtilHelm: enforcerUtilHelm,
enforcerUtil: enforcerUtil,
helmAppService: helmAppService,
userService: userService,
k8sCommonService: k8sCommonService,
terminalEnvVariables: envVariables.TerminalEnvVariables,
fluxAppService: fluxAppService,
argoApplicationReadService: argoApplicationReadService,
}
}

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

} else if appType == bean2.ArgoAppType {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(appIdString)
appIdentifier, err := helper.DecodeExternalArgoAppId(appIdString)
if err != nil {
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
Expand All @@ -301,7 +302,7 @@ func (handler *K8sApplicationRestHandlerImpl) GetHostUrlsByBatch(w http.Response
}
//RBAC enforcer Ends

appDetail, err := handler.argoApplication.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
appDetail, err := handler.argoApplicationReadService.GetAppDetail(appIdentifier.AppName, appIdentifier.Namespace, appIdentifier.ClusterId)
if err != nil {
apiError := clientErrors.ConvertToApiError(err)
if apiError != nil {
Expand Down Expand Up @@ -721,12 +722,12 @@ func (handler *K8sApplicationRestHandlerImpl) requestValidationAndRBAC(w http.Re
}
//RBAC enforcer ends here
} else if request.AppType == bean2.ArgoAppType && request.ExternalArgoApplicationName != "" {
appIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
appIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
if err != nil {
handler.logger.Errorw(bean2.AppIdDecodingError, "err", err, "appIdentifier", request.AppIdentifier)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
}
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), appIdentifier, request.K8sRequest)
if err != nil || !valid {
handler.logger.Errorw("error in validating resource request", "err", err)
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
Expand Down Expand Up @@ -1145,14 +1146,14 @@ func (handler *K8sApplicationRestHandlerImpl) verifyRbacForAppRequests(token str
envObject := ""
switch request.AppType {
case bean2.ArgoAppType:
argoAppIdentifier, err := argoApplication.DecodeExternalArgoAppId(request.AppId)
argoAppIdentifier, err := helper.DecodeExternalArgoAppId(request.AppId)
if err != nil {
handler.logger.Errorw("error in decoding appId", "err", err, "appId", request.AppId)
return false, err
}
request.ClusterId = argoAppIdentifier.ClusterId
request.ExternalArgoApplicationName = argoAppIdentifier.AppName
valid, err := handler.k8sApplicationService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
valid, err := handler.argoApplicationReadService.ValidateArgoResourceRequest(r.Context(), argoAppIdentifier, request.K8sRequest)
if err != nil || !valid {
handler.logger.Errorw("error in validating resource request", "err", err)
return false, err
Expand Down
22 changes: 12 additions & 10 deletions cmd/external-app/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading