Skip to content

Commit 4f117b5

Browse files
Merge branch 'main' into statefulset-chart-upgrade
2 parents c0b2500 + d042869 commit 4f117b5

File tree

396 files changed

+11895
-8525
lines changed

Some content is hidden

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

396 files changed

+11895
-8525
lines changed

.gitbook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ redirects:
7777
global-configurations/api-token: user-guide/global-configurations/authorization/api-tokens.md
7878
user-guide/creating-application/workflow/ci-pipeline2: user-guide/creating-application/workflow/ci-pipeline.md
7979
user-guide/clusters: user-guide/resource-browser.md
80+
usage/clusters: user-guide/resource-browser.md

CHANGELOG/release-notes-v0.7.0.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
## v0.7.0
2+
3+
## Bugs
4+
- fix: extra labels propagation made env driven (#5274)
5+
- fix: App clone config map fix (#5268)
6+
- fix: latest version in default cluster and on UI (#5259)
7+
- fix: update CVE's severity and store multiple same CVE's in multiple packages (#5168)
8+
- fix: fixing force push for gitops (#5152)
9+
- fix: extra labels propagation based on k8s label regex matching (#5216)
10+
- fix: invalid runner status (#5189)
11+
- fix: revert changes from main (#5206)
12+
- fix: apps and jobs permission (#5110)
13+
- fix: added Copyright (#5172)
14+
- fix:removed unused env var (#5174)
15+
- fix: Handling all cases for 5xx (#5100)
16+
- fix: trivy scan step command fix (#5162)
17+
- fix: added extra args in trivy cmds (#5146)
18+
- fix: proxyRouter empty data err panic handling (#5147)
19+
- fix: handling side-effects for displaying external helm apps with same name across diff namespaces and clusters (#4951)
20+
- fix: fatal log removed (#5043)
21+
- fix: added a check for restricting managers to assign superadmin through permission groups (#5025)
22+
- fix: SHOW_DOCKER_BUILD_ARGS variable not working as expected (#5117)
23+
- fix: dependabot version upgrade (#5089)
24+
- fix: containers are missing from app-details page in argocd app (#4973)
25+
- fix:resolved PR review comments also remove check for virtual cluster (#5095)
26+
- fix:handled namespace case if deleted by kubectl (#5081)
27+
- fix: oci chart were getting deployed through gitops (#5088)
28+
- fix: argocd config update fix (#5074)
29+
- fix: handle 5xx in fetch resource tree api and cd-trigger (#5050)
30+
- fix: gitops update updated (#5055)
31+
- fix: App create api validations (#5019)
32+
- fix: git material saved in transaction (#5040)
33+
- fix: panic while pulling images (#5036)
34+
- fix: terminal stuck in connecting state (#4989)
35+
- fix: handle for wrong format of k8s version in semvercompare func in cronjob template charts (#5016)
36+
- fix: Dockerfile ubuntu version (#5022)
37+
- fix: application status changes to HIBERNATING, when hibernation fails due to some reason (#5005)
38+
- fix: deleted api token can be reused if created again with same name (#4978)
39+
- fix: Kubelink Requests getting Failed for gRPC method GetAppDetails (#5012)
40+
- fix: terminate sync if in progress (#4946)
41+
- fix: grpc error handling for TemplateChart req (#4980)
42+
- fix: removed redundant import (#5004)
43+
- fix: image promotion sql script (#4996)
44+
- fix: image-approval-migartion fix (#4994)
45+
- fix: ci-cd count per day in telemetry data (#4931)
46+
## Enhancements
47+
- feat: notifier behind nats (#5185)
48+
- feat: cd pipeline deployment history refactoring (#5200)
49+
- feat: wire nil test in pre ci pipeline (#4858)
50+
- feat: added recovery counter metrics (#5124)
51+
- feat: auto remediation (#5137)
52+
- feat: support for ca cert in trivy (#5064)
53+
- feat: validation for pipeline Type (#4670)
54+
- feat: propagate labels such as envName and projectName (#5063)
55+
- feat: Plugin to trigger Devtron Job (#5053)
56+
- feat: CD Trigger Plugin (#4810)
57+
- feat: Introduction to feasibility in Deployment (#4862)
58+
## Documentation
59+
- doc: Created Resource Watcher Doc (#5193)
60+
- doc: Modified Portforward Section to Kubectl Section (#5236)
61+
- doc: Added enhancements to security doc (#5203)
62+
- docs: update readme to include multi arch flag (#4998)
63+
- docs: config.md updatation for new flag (#5061)
64+
- doc: Fixes in Documentation for May Month (#5150)
65+
- doc: Created Resource Watcher Doc (#5193)
66+
- doc: Modified Portforward Section to Kubectl Section (#5236)
67+
- doc: Added enhancements to security doc (#5203)
68+
- docs: update readme to include multi arch flag (#4998)
69+
- docs: config.md updatation for new flag (#5061)
70+
- doc: Added kubectl port-fwd section in RB (#5139)
71+
- doc: Added Bitbucket Data Center in GitOps doc (#5075)
72+
- doc: Image promotion policy (#4762)
73+
- doc: Revamped Resource Browser Doc (#5035)
74+
- doc: Added Bulk Restart in Application Groups doc (#5080)
75+
- doc: Added new doc in the index (#5029)
76+
- doc: Changes made in the doc according to the newer version (#5024)
77+
- doc: Added Linked CI with Child Info + Runtime Build Parameters (#4991)
78+
## Others
79+
- chore: updated vendor (#5166)
80+
- chore: gitops validation in api (#5082)
81+
- chore: release v2 migration (#5126)
82+
- chore: migration update for remote connection config (#5113)
83+
- chore: added sql for release and release channels (#4898)
84+
- chore: resource scan migration (#4977)
85+
- chore: image promotion migration (#4992)
86+
- misc: uniform GitHub action (#5069)
87+
88+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20 AS build-env
1+
FROM golang:1.21 AS build-env
22

33
RUN echo $GOPATH
44
RUN apt update

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ helm install devtron devtron/devtron-operator --create-namespace --namespace dev
160160

161161
```
162162

163+
### Install Multi-Architecture Nodes (ARM and AMD)
164+
165+
To install Devtron on clusters with the multi-architecture nodes (ARM and AMD), append the Devtron installation command with ```--set installer.arch=multi-arch```
166+
163167
## :blue_heart: Technology
164168

165169
Devtron is built on some of the most trusted and loved technologies:

Wire.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build wireinject
2+
// +build wireinject
3+
14
/*
25
* Copyright (c) 2024. Devtron Inc.
36
*
@@ -14,9 +17,6 @@
1417
* limitations under the License.
1518
*/
1619

17-
//go:build wireinject
18-
// +build wireinject
19-
2020
package main
2121

2222
import (
@@ -39,6 +39,7 @@ import (
3939
"github.com/devtron-labs/devtron/api/connector"
4040
"github.com/devtron-labs/devtron/api/dashboardEvent"
4141
"github.com/devtron-labs/devtron/api/deployment"
42+
"github.com/devtron-labs/devtron/api/devtronResource"
4243
"github.com/devtron-labs/devtron/api/externalLink"
4344
client "github.com/devtron-labs/devtron/api/helm-app"
4445
"github.com/devtron-labs/devtron/api/infraConfig"
@@ -121,8 +122,6 @@ import (
121122
deployment2 "github.com/devtron-labs/devtron/pkg/deployment"
122123
git2 "github.com/devtron-labs/devtron/pkg/deployment/gitOps/git"
123124
"github.com/devtron-labs/devtron/pkg/deploymentGroup"
124-
"github.com/devtron-labs/devtron/pkg/devtronResource"
125-
repository9 "github.com/devtron-labs/devtron/pkg/devtronResource/repository"
126125
"github.com/devtron-labs/devtron/pkg/dockerRegistry"
127126
"github.com/devtron-labs/devtron/pkg/eventProcessor"
128127
"github.com/devtron-labs/devtron/pkg/generateManifest"
@@ -195,6 +194,9 @@ func InitializeApp() (*App, error) {
195194

196195
eventProcessor.EventProcessorWireSet,
197196
workflow3.WorkflowWireSet,
197+
198+
devtronResource.DevtronResourceWireSet,
199+
198200
// -------wireset end ----------
199201
// -------
200202
gitSensor.GetConfig,
@@ -748,6 +750,7 @@ func InitializeApp() (*App, error) {
748750

749751
app.NewAppCrudOperationServiceImpl,
750752
wire.Bind(new(app.AppCrudOperationService), new(*app.AppCrudOperationServiceImpl)),
753+
app.GetCrudOperationServiceConfig,
751754
pipelineConfig.NewAppLabelRepositoryImpl,
752755
wire.Bind(new(pipelineConfig.AppLabelRepository), new(*pipelineConfig.AppLabelRepositoryImpl)),
753756

@@ -950,12 +953,6 @@ func InitializeApp() (*App, error) {
950953
resourceQualifiers.NewQualifierMappingServiceImpl,
951954
wire.Bind(new(resourceQualifiers.QualifierMappingService), new(*resourceQualifiers.QualifierMappingServiceImpl)),
952955

953-
repository9.NewDevtronResourceSearchableKeyRepositoryImpl,
954-
wire.Bind(new(repository9.DevtronResourceSearchableKeyRepository), new(*repository9.DevtronResourceSearchableKeyRepositoryImpl)),
955-
956-
devtronResource.NewDevtronResourceSearchableKeyServiceImpl,
957-
wire.Bind(new(devtronResource.DevtronResourceSearchableKeyService), new(*devtronResource.DevtronResourceSearchableKeyServiceImpl)),
958-
959956
argocdServer.NewArgoClientWrapperServiceImpl,
960957
wire.Bind(new(argocdServer.ArgoClientWrapperService), new(*argocdServer.ArgoClientWrapperServiceImpl)),
961958

api/auth/user/UserAuthHandler.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func (handler UserAuthHandlerImpl) AddDefaultPolicyAndRoles(w http.ResponseWrite
237237

238238
}
239239
func (handler UserAuthHandlerImpl) AuthVerification(w http.ResponseWriter, r *http.Request) {
240-
verified, err := handler.userAuthService.AuthVerification(r)
240+
verified, _, err := handler.userAuthService.AuthVerification(r)
241241
if err != nil {
242242
handler.logger.Errorw("service err, AuthVerification", "err", err)
243243
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
@@ -253,13 +253,14 @@ func (handler UserAuthHandlerImpl) AuthVerificationV2(w http.ResponseWriter, r *
253253
isSuperAdmin = true
254254
}
255255
response := make(map[string]interface{})
256-
verified, err := handler.userAuthService.AuthVerification(r)
256+
verified, emailId, err := handler.userAuthService.AuthVerification(r)
257257
if err != nil {
258258
handler.logger.Errorw("service err, AuthVerification", "err", err)
259259
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
260260
return
261261
}
262262
response["isSuperAdmin"] = isSuperAdmin
263263
response["isVerified"] = verified
264+
response["emailId"] = emailId
264265
common.WriteJsonResp(w, nil, response, http.StatusOK)
265266
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
package devtronResource
2+
3+
import (
4+
"fmt"
5+
apiBean "github.com/devtron-labs/devtron/api/devtronResource/bean"
6+
"github.com/devtron-labs/devtron/api/restHandler/common"
7+
"github.com/devtron-labs/devtron/pkg/auth/authorisation/casbin"
8+
"github.com/devtron-labs/devtron/pkg/devtronResource"
9+
"github.com/devtron-labs/devtron/pkg/devtronResource/adapter"
10+
"github.com/devtron-labs/devtron/pkg/devtronResource/bean"
11+
"github.com/devtron-labs/devtron/pkg/devtronResource/history/deployment/cdPipeline"
12+
"github.com/devtron-labs/devtron/util/rbac"
13+
"github.com/gorilla/schema"
14+
"go.uber.org/zap"
15+
"net/http"
16+
)
17+
18+
type HistoryRestHandler interface {
19+
GetDeploymentHistory(w http.ResponseWriter, r *http.Request)
20+
GetDeploymentHistoryConfigList(w http.ResponseWriter, r *http.Request)
21+
}
22+
23+
type HistoryRestHandlerImpl struct {
24+
logger *zap.SugaredLogger
25+
enforcer casbin.Enforcer
26+
deploymentHistoryService cdPipeline.DeploymentHistoryService
27+
apiReqDecoderService devtronResource.APIReqDecoderService
28+
enforcerUtil rbac.EnforcerUtil
29+
}
30+
31+
func NewHistoryRestHandlerImpl(logger *zap.SugaredLogger,
32+
enforcer casbin.Enforcer,
33+
deploymentHistoryService cdPipeline.DeploymentHistoryService,
34+
apiReqDecoderService devtronResource.APIReqDecoderService,
35+
enforcerUtil rbac.EnforcerUtil) *HistoryRestHandlerImpl {
36+
return &HistoryRestHandlerImpl{
37+
logger: logger,
38+
enforcer: enforcer,
39+
deploymentHistoryService: deploymentHistoryService,
40+
apiReqDecoderService: apiReqDecoderService,
41+
enforcerUtil: enforcerUtil,
42+
}
43+
}
44+
45+
func (handler *HistoryRestHandlerImpl) GetDeploymentHistory(w http.ResponseWriter, r *http.Request) {
46+
kind, _, _, caughtError := getKindSubKindVersion(w, r)
47+
if caughtError || kind != bean.DevtronResourceCdPipeline.ToString() {
48+
common.WriteJsonResp(w, fmt.Errorf(apiBean.RequestInvalidKindVersionErrMessage), nil, http.StatusBadRequest)
49+
return
50+
}
51+
v := r.URL.Query()
52+
var decoder = schema.NewDecoder()
53+
decoder.IgnoreUnknownKeys(true)
54+
queryParams := apiBean.GetHistoryQueryParams{}
55+
err := decoder.Decode(&queryParams, v)
56+
if err != nil {
57+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
58+
return
59+
}
60+
decodedReqBean, err := handler.apiReqDecoderService.GetFilterCriteriaParamsForDeploymentHistory(queryParams.FilterCriteria)
61+
if err != nil {
62+
handler.logger.Errorw("error in getting filter criteria params", "err", err, "filterCriteria", queryParams.FilterCriteria)
63+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
64+
return
65+
}
66+
67+
// RBAC START
68+
token := r.Header.Get("token")
69+
resourceName := handler.enforcerUtil.GetAppRBACNameByAppId(decodedReqBean.AppId)
70+
if ok := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, resourceName); !ok {
71+
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
72+
return
73+
}
74+
// RBAC END
75+
76+
resp, err := handler.deploymentHistoryService.
77+
GetCdPipelineDeploymentHistory(adapter.GetCDDeploymentHistoryListReq(&queryParams, decodedReqBean))
78+
if err != nil {
79+
handler.logger.Errorw("service error, GetCdPipelineDeploymentHistory", "err", err)
80+
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
81+
return
82+
}
83+
common.WriteJsonResp(w, err, resp, http.StatusOK)
84+
return
85+
}
86+
87+
func (handler *HistoryRestHandlerImpl) GetDeploymentHistoryConfigList(w http.ResponseWriter, r *http.Request) {
88+
kind, _, _, caughtError := getKindSubKindVersion(w, r)
89+
if caughtError || kind != bean.DevtronResourceCdPipeline.ToString() {
90+
common.WriteJsonResp(w, fmt.Errorf(apiBean.RequestInvalidKindVersionErrMessage), nil, http.StatusBadRequest)
91+
return
92+
}
93+
v := r.URL.Query()
94+
var decoder = schema.NewDecoder()
95+
decoder.IgnoreUnknownKeys(true)
96+
queryParams := apiBean.GetHistoryConfigQueryParams{}
97+
err := decoder.Decode(&queryParams, v)
98+
if err != nil {
99+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
100+
return
101+
}
102+
decodedReqBean, err := handler.apiReqDecoderService.GetFilterCriteriaParamsForDeploymentHistory(queryParams.FilterCriteria)
103+
if err != nil {
104+
handler.logger.Errorw("error in getting filter criteria params", "err", err, "filterCriteria", queryParams.FilterCriteria)
105+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
106+
return
107+
}
108+
//RBAC START
109+
token := r.Header.Get("token")
110+
resourceName := handler.enforcerUtil.GetAppRBACNameByAppId(decodedReqBean.AppId)
111+
if isValidated := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionGet, resourceName); !isValidated {
112+
common.WriteJsonResp(w, fmt.Errorf("unauthorized user"), "Unauthorized User", http.StatusForbidden)
113+
return
114+
}
115+
//RBAC END
116+
resp, err := handler.deploymentHistoryService.
117+
GetCdPipelineDeploymentHistoryConfigList(adapter.GetCDDeploymentHistoryConfigListReq(&queryParams, decodedReqBean))
118+
if err != nil {
119+
handler.logger.Errorw("service error, GetCdPipelineDeploymentHistoryConfigList", "err", err)
120+
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
121+
return
122+
}
123+
common.WriteJsonResp(w, err, resp, http.StatusOK)
124+
return
125+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package devtronResource
2+
3+
import "github.com/gorilla/mux"
4+
5+
type HistoryRouter interface {
6+
InitDtResourceHistoryRouter(devtronResourceRouter *mux.Router)
7+
}
8+
9+
type HistoryRouterImpl struct {
10+
dtResourceHistoryRestHandler HistoryRestHandler
11+
}
12+
13+
func NewHistoryRouterImpl(dtResourceHistoryRestHandler HistoryRestHandler) *HistoryRouterImpl {
14+
return &HistoryRouterImpl{dtResourceHistoryRestHandler: dtResourceHistoryRestHandler}
15+
}
16+
17+
func (router *HistoryRouterImpl) InitDtResourceHistoryRouter(historyRouter *mux.Router) {
18+
historyRouter.Path("/deployment/config/{kind:[a-zA-Z0-9/-]+}/{version:[a-zA-Z0-9]+}").
19+
HandlerFunc(router.dtResourceHistoryRestHandler.GetDeploymentHistoryConfigList).Methods("GET")
20+
21+
historyRouter.Path("/deployment/{kind:[a-zA-Z0-9/-]+}/{version:[a-zA-Z0-9]+}").
22+
HandlerFunc(router.dtResourceHistoryRestHandler.GetDeploymentHistory).Methods("GET")
23+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package devtronResource
2+
3+
import (
4+
"fmt"
5+
apiBean "github.com/devtron-labs/devtron/api/devtronResource/bean"
6+
"github.com/devtron-labs/devtron/api/restHandler/common"
7+
"github.com/devtron-labs/devtron/pkg/devtronResource/helper"
8+
"github.com/gorilla/mux"
9+
"net/http"
10+
)
11+
12+
func getKindSubKindVersion(w http.ResponseWriter, r *http.Request) (kind string, subKind string, version string, caughtError bool) {
13+
vars := mux.Vars(r)
14+
kindVar := vars[apiBean.PathParamKind]
15+
versionVar := vars[apiBean.PathParamVersion]
16+
kind, subKind, statusCode, err := resolveKindSubKindValues(kindVar)
17+
if err != nil {
18+
common.WriteJsonResp(w, err, nil, statusCode)
19+
caughtError = true
20+
}
21+
return kind, subKind, versionVar, caughtError
22+
}
23+
24+
func resolveKindSubKindValues(kindVar string) (kind, subKind string, statusCode int, err error) {
25+
kind, subKind, err = helper.GetKindAndSubKindFrom(kindVar)
26+
if err != nil {
27+
err = fmt.Errorf("invalid parameter: kind")
28+
statusCode = http.StatusBadRequest
29+
}
30+
return kind, subKind, statusCode, err
31+
}

0 commit comments

Comments
 (0)