Skip to content

Commit 16d4cce

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feat-acr-polling-plugin
2 parents 7e9bf88 + 214bd62 commit 16d4cce

File tree

59 files changed

+1785
-216
lines changed

Some content is hidden

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

59 files changed

+1785
-216
lines changed

.gitbook.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ redirects:
1616
setup/upgrade/devtron-upgrade-0.2.x-0.3.x: getting-started/upgrade/devtron-upgrade-0.2.x-0.3.x
1717
setup/global-configurations: user-guide/global-configurations/README.md
1818
setup/global-configurations/gitops: user-guide/global-configurations/gitops.md
19-
setup/global-configurations/custom-charts: user-guide/global-configurations/custom-charts.md
19+
setup/global-configurations/custom-charts: user-guide/global-configurations/deployment-charts.md
2020
setup/global-configurations/user-access: user-guide/global-configurations/authorization/user-access.md
2121
setup/global-configurations/external-links: user-guide/global-configurations/external-links.md
2222
setup/global-configurations/projects: user-guide/global-configurations/projects.md
@@ -109,7 +109,7 @@ redirects:
109109
getting-started/global-configurations/filter-condition: user-guide/global-configurations/filter-condition.md
110110
getting-started/global-configurations/build-infra: user-guide/global-configurations/build-infra.md
111111
getting-started/global-configurations/gitops: user-guide/global-configurations/gitops.md
112-
getting-started/global-configurations/custom-charts: user-guide/global-configurations/custom-charts.md
112+
getting-started/global-configurations/custom-charts: user-guide/global-configurations/deployment-charts.md
113113
getting-started/global-configurations/external-links: user-guide/global-configurations/external-links.md
114114
getting-started/global-configurations/projects: user-guide/global-configurations/projects.md
115115
getting-started/global-configurations/manage-notification: user-guide/global-configurations/manage-notification.md
@@ -127,4 +127,5 @@ redirects:
127127
user-guide/clusters: user-guide/resource-browser.md
128128
usage/clusters: user-guide/resource-browser.md
129129
global-configurations/authorization/sso-login/okta: user-guide/global-configurations/authorization/sso/okta.md
130-
usage/applications/creating-application/ci-pipeline/ci-build-pre-post-plugins: user-guide/creating-application/workflow/ci-build-pre-post-plugins.md
130+
usage/applications/creating-application/ci-pipeline/ci-build-pre-post-plugins: user-guide/creating-application/workflow/ci-build-pre-post-plugins.md
131+
global-configurations/custom-charts: user-guide/global-configurations/deployment-charts.md

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ RUN apt clean autoclean
1717
RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
1818
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/devtron .
1919
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
20-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
20+
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
21+
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
2122
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
2223
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
2324
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin

DockerfileEA

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ RUN apt autoremove -y && rm -rf /var/lib/apt/lists/*
1717
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/auth_model.conf .
1818
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/cmd/external-app/devtron-ea .
1919

20-
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
20+
#COPY --from=build-env /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
21+
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/argocd-assets/ /go/src/github.com/devtron-labs/devtron/vendor/github.com/argoproj/argo-cd/assets
2122
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/devtron-reference-helm-charts scripts/devtron-reference-helm-charts
2223
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/sql scripts/sql
2324
COPY --from=build-env /go/src/github.com/devtron-labs/devtron/scripts/casbin scripts/casbin

api/restHandler/DeploymentConfigurationRestHandler.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ func (handler *DeploymentConfigurationRestHandlerImpl) enforceForAppAndEnv(appNa
115115
return false
116116
}
117117

118-
object = handler.enforcerUtil.GetEnvRBACNameByAppAndEnvName(appName, envName)
119-
if ok := handler.enforcer.Enforce(token, casbin.ResourceEnvironment, action, object); !ok {
120-
return false
118+
if len(envName) > 0 {
119+
object = handler.enforcerUtil.GetEnvRBACNameByAppAndEnvName(appName, envName)
120+
if ok := handler.enforcer.Enforce(token, casbin.ResourceEnvironment, action, object); !ok {
121+
return false
122+
}
121123
}
122124
return true
123125
}

api/restHandler/GlobalPluginRestHandler.go

+67
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535

3636
type GlobalPluginRestHandler interface {
3737
PatchPlugin(w http.ResponseWriter, r *http.Request)
38+
CreatePlugin(w http.ResponseWriter, r *http.Request)
3839

3940
GetAllGlobalVariables(w http.ResponseWriter, r *http.Request)
4041
ListAllPlugins(w http.ResponseWriter, r *http.Request)
@@ -46,6 +47,7 @@ type GlobalPluginRestHandler interface {
4647
GetPluginDetailByIds(w http.ResponseWriter, r *http.Request)
4748
GetAllUniqueTags(w http.ResponseWriter, r *http.Request)
4849
MigratePluginData(w http.ResponseWriter, r *http.Request)
50+
GetAllPluginMinData(w http.ResponseWriter, r *http.Request)
4951
}
5052

5153
func NewGlobalPluginRestHandler(logger *zap.SugaredLogger, globalPluginService plugin.GlobalPluginService,
@@ -420,3 +422,68 @@ func (handler *GlobalPluginRestHandlerImpl) MigratePluginData(w http.ResponseWri
420422
}
421423
common.WriteJsonResp(w, nil, nil, http.StatusOK)
422424
}
425+
426+
func (handler *GlobalPluginRestHandlerImpl) CreatePlugin(w http.ResponseWriter, r *http.Request) {
427+
userId, err := handler.userService.GetLoggedInUser(r)
428+
if userId == 0 || err != nil {
429+
common.WriteJsonResp(w, err, "Unauthorized User", http.StatusUnauthorized)
430+
return
431+
}
432+
token := r.Header.Get("token")
433+
appId, err := common.ExtractIntQueryParam(w, r, "appId", 0)
434+
if err != nil {
435+
return
436+
}
437+
ok, err := handler.IsUserAuthorized(token, appId)
438+
if err != nil {
439+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
440+
return
441+
}
442+
if !ok {
443+
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
444+
return
445+
}
446+
decoder := json.NewDecoder(r.Body)
447+
var pluginDataDto bean.PluginParentMetadataDto
448+
err = decoder.Decode(&pluginDataDto)
449+
if err != nil {
450+
handler.logger.Errorw("request err, CreatePlugin", "error", err, "payload", pluginDataDto)
451+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
452+
return
453+
}
454+
handler.logger.Infow("request payload received for creating plugins", pluginDataDto, "userId", userId)
455+
456+
pluginVersionId, err := handler.globalPluginService.CreatePluginOrVersions(&pluginDataDto, userId)
457+
if err != nil {
458+
handler.logger.Errorw("service error, error in creating plugin", "pluginCreateRequestDto", pluginDataDto, "err", err)
459+
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
460+
return
461+
}
462+
463+
common.WriteJsonResp(w, nil, bean.NewPluginMinDto().WithPluginVersionId(pluginVersionId), http.StatusOK)
464+
}
465+
466+
func (handler *GlobalPluginRestHandlerImpl) GetAllPluginMinData(w http.ResponseWriter, r *http.Request) {
467+
token := r.Header.Get("token")
468+
appId, err := common.ExtractIntQueryParam(w, r, "appId", 0)
469+
if err != nil {
470+
return
471+
}
472+
ok, err := handler.IsUserAuthorized(token, appId)
473+
if err != nil {
474+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
475+
return
476+
}
477+
if !ok {
478+
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
479+
return
480+
}
481+
482+
pluginDetail, err := handler.globalPluginService.GetAllPluginMinData()
483+
if err != nil {
484+
handler.logger.Errorw("error in getting all unique tags", "err", err)
485+
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
486+
return
487+
}
488+
common.WriteJsonResp(w, nil, pluginDetail, http.StatusOK)
489+
}

api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go

+4-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"encoding/json"
2222
"errors"
2323
"fmt"
24-
"github.com/devtron-labs/devtron/internal/sql/repository/appWorkflow"
2524
"golang.org/x/exp/maps"
2625
"io"
2726
"net/http"
@@ -496,19 +495,13 @@ func (handler *PipelineConfigRestHandlerImpl) getCdPipelinesForCIPatchRbac(patch
496495
// find the workflow in which we are patching and use the workflow id to fetch all the workflow mappings using the workflow.
497496
// get cd pipeline ids from those workflows and fetch the cd pipelines.
498497

499-
// get the ciPipeline
500-
switchFromPipelineId, switchFromType := patchRequest.SwitchSourceInfo()
501-
502-
// in app workflow mapping all the build source types are 'CI_PIPELINE' type, except external -> WEBHOOK.
503-
componentType := appWorkflow.CIPIPELINE
504-
if switchFromType == CiPipeline.EXTERNAL {
505-
componentType = appWorkflow.WEBHOOK
506-
}
498+
// get the ciPipeline patch source info
499+
componentId, componentType := patchRequest.PatchSourceInfo()
507500

508501
// the appWorkflowId can be taken from patchRequest.AppWorkflowId but doing this can make 2 sources of truth to find the workflow
509-
sourceAppWorkflowMapping, err := handler.appWorkflowService.FindWFMappingByComponent(componentType, switchFromPipelineId)
502+
sourceAppWorkflowMapping, err := handler.appWorkflowService.FindWFMappingByComponent(componentType, componentId)
510503
if err != nil {
511-
handler.Logger.Errorw("error in finding the appWorkflowMapping using componentId and componentType", "componentType", componentType, "componentId", switchFromPipelineId, "err", err)
504+
handler.Logger.Errorw("error in finding the appWorkflowMapping using componentId and componentType", "componentType", componentType, "componentId", componentId, "err", err)
512505
return nil, err
513506
}
514507

api/router/GlobalPluginRouter.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type GlobalPluginRouterImpl struct {
4141
func (impl *GlobalPluginRouterImpl) initGlobalPluginRouter(globalPluginRouter *mux.Router) {
4242
globalPluginRouter.Path("/migrate").
4343
HandlerFunc(impl.globalPluginRestHandler.MigratePluginData).Methods("PUT")
44-
44+
globalPluginRouter.Path("/create").
45+
HandlerFunc(impl.globalPluginRestHandler.CreatePlugin).Methods("POST")
4546
// versioning impact handling to be done for below apis,
4647
globalPluginRouter.Path("").
4748
HandlerFunc(impl.globalPluginRestHandler.PatchPlugin).Methods("POST")
@@ -68,5 +69,7 @@ func (impl *GlobalPluginRouterImpl) initGlobalPluginRouter(globalPluginRouter *m
6869

6970
globalPluginRouter.Path("/list/tags").
7071
HandlerFunc(impl.globalPluginRestHandler.GetAllUniqueTags).Methods("GET")
72+
globalPluginRouter.Path("/list/v2/min").
73+
HandlerFunc(impl.globalPluginRestHandler.GetAllPluginMinData).Methods("GET")
7174

7275
}

devtron-images.txt.source

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
quay.io/devtron/image-scanner:137872c2-141-23848
2+
quay.io/devtron/inception:473deaa4-185-21582
3+
quay.io/devtron/hyperion:291c4c75-280-23860
4+
public.ecr.aws/docker/library/redis:7.0.5-alpine
5+
quay.io/argoproj/argocd:v2.5.2
6+
quay.io/argoproj/workflow-controller:v3.4.3
7+
quay.io/devtron/authenticator:e414faff-393-13273
8+
quay.io/devtron/bats:v1.4.1
9+
quay.io/devtron/busybox:1.31.1
10+
quay.io/devtron/chart-sync:5a1d0301-150-23845
11+
quay.io/devtron/curl:7.73.0
12+
quay.io/devtron/dashboard:5f95d187-690-23841
13+
quay.io/devtron/devtron-utils:dup-chart-repo-v1.1.0
14+
quay.io/devtron/devtron:291c4c75-434-23853
15+
quay.io/devtron/ci-runner:48aca9f4-138-23844
16+
quay.io/devtron/dex:v2.30.2
17+
quay.io/devtron/git-sensor:86e13283-200-23847
18+
quay.io/devtron/grafana:7.3.1
19+
quay.io/devtron/k8s-sidecar:1.1.0
20+
quay.io/devtron/k8s-utils:tutum-curl
21+
quay.io/devtron/kubectl:latest
22+
quay.io/devtron/kubelink:0dee6306-564-23843
23+
quay.io/devtron/kubewatch:850b40d5-419-23840
24+
quay.io/devtron/lens:56211042-333-23839
25+
quay.io/devtron/migrator:v4.16.2
26+
quay.io/devtron/nats-box
27+
quay.io/devtron/nats-server-config-reloader:0.6.2
28+
quay.io/devtron/nats:2.9.3-alpine
29+
quay.io/devtron/notifier:9639b1ab-372-23850
30+
quay.io/devtron/postgres:11.9
31+
quay.io/devtron/postgres_exporter:v0.10.1
32+
quay.io/devtron/prometheus-nats-exporter:0.9.0
33+
quay.io/devtron/minio:RELEASE.2021-02-14T04-01-33Z
34+
quay.io/devtron/clair:4.3.6
35+
quay.io/devtron/postgres:11.9.0-debian-10-r26
36+
quay.io/devtron/postgres_exporter:v0.4.7
37+
quay.io/devtron/minio-mc:RELEASE.2021-02-14T04-28-06Z
38+
quay.io/devtron/minideb:latest
39+

docs/SUMMARY.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [Install Devtron with CI/CD and GitOps (Argo CD)](setup/install/install-devtron-with-cicd-with-gitops.md)
88
* [Install Devtron without Integrations](setup/install/install-devtron.md)
99
* [Install Devtron on Minikube, Microk8s, K3s, Kind, Cloud VMs](setup/install/Install-devtron-on-Minikube-Microk8s-K3s-Kind.md)
10+
* [Install Devtron on Airgapped Environment](setup/install/install-devtron-in-airgapped-environment.md)
1011
* [Demo on Popular Cloud Providers](setup/install/demo-tutorials.md)
1112
* [Backup for Disaster Recovery](setup/install/devtron-backup.md)
1213
* [Uninstall Devtron](setup/install/uninstall-devtron.md)
@@ -24,7 +25,7 @@
2425
* [Git Accounts](user-guide/global-configurations/git-accounts.md)
2526
* [Container/OCI Registry](user-guide/global-configurations/container-registries.md)
2627
* [Chart Repositories](user-guide/global-configurations/chart-repo.md)
27-
* [Custom Charts](user-guide/global-configurations/custom-charts.md)
28+
* [Deployment Charts](user-guide/global-configurations/deployment-charts.md)
2829
* [Authorization](user-guide/global-configurations/authorization/README.md)
2930
* [SSO Login Services](user-guide/global-configurations/sso-login.md)
3031
* [Google](user-guide/global-configurations/authorization/sso/google.md)
@@ -135,9 +136,14 @@
135136
* [Code-Scan](user-guide/plugins/code-scan.md)
136137
* [Copacetic](user-guide/plugins/copacetic.md)
137138
* [Copy Container Image](user-guide/plugins/copy-container-image.md)
139+
* [Cosign](user-guide/plugins/cosign.md)
140+
* [CraneCopy](user-guide/plugins/crane-copy.md)
138141
* [Dependency track - Maven & Gradle](user-guide/plugins/dependency-track-maven-gradle.md)
139142
* [Dependency track - NodeJS](user-guide/plugins/dependency-track-nodejs.md)
140143
* [Dependency track - Python](user-guide/plugins/dependency-track-python.md)
144+
* [Devtron CD Trigger](user-guide/plugins/devtron-cd-trigger.md)
145+
* [Devtron Job Trigger](user-guide/plugins/devtron-job-trigger.md)
146+
* [DockerSlim](user-guide/plugins/docker-slim.md)
141147
* [GoLang-migrate](user-guide/plugins/golang-migrate.md)
142148
* [Jenkins](user-guide/plugins/jenkins.md)
143149
* [K6 Load Testing](user-guide/plugins/k6-load-testing.md)
@@ -159,4 +165,4 @@
159165
* [Pull Helm Charts from OCI Registry](user-guide/use-cases/oci-pull.md)
160166
* [Telemetry Overview](user-guide/telemetry.md)
161167
* [Devtron on Graviton](reference/graviton.md)
162-
* [Release Notes](https://github.com/devtron-labs/devtron/releases)
168+
* [Release Notes](https://github.com/devtron-labs/devtron/releases)

docs/reference/glossary.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Temporarily marking a node as unschedulable, preventing new pods from being assi
6464

6565
CronJob is used to create Jobs on a repeating schedule. It is commonly used for running periodic tasks with no manual intervention. In Devtron, you can view a list of cronjobs by going to Resource Browser → (choose a cluster) → Workloads → CronJob. [Read More...](../user-guide/creating-application/deployment-template/job-and-cronjob.md#2.-cronjob)
6666

67-
### Custom Charts
67+
### Deployment Charts
6868

69-
Devtron offers a variety of ready-made Helm charts for common tasks and functions. If you have a specific need that isn't met by these preconfigured charts, super-admins have the permission to upload their own custom charts. Once uploaded, these custom charts become accessible for use by all users on the Devtron platform. [Read More...](../user-guide/global-configurations/custom-charts.md)
69+
Devtron offers a variety of ready-made Helm charts for common tasks and functions. If you have a specific need that isn't met by these preconfigured charts, super-admins have the permission to upload their own charts. Once uploaded, these charts become accessible for use by all users on the Devtron platform. [Read More...](../user-guide/global-configurations/deployment-charts.md)
7070

7171
### DaemonSet
7272

0 commit comments

Comments
 (0)