Skip to content

Commit f4bdb34

Browse files
committed
Merge branch 'main' of github.com:devtron-labs/devtron into control-feature-rollout
# Conflicts: # go.mod # go.sum
2 parents 5e0fc93 + b3f4f78 commit f4bdb34

File tree

1,083 files changed

+20138
-5199
lines changed

Some content is hidden

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

1,083 files changed

+20138
-5199
lines changed

.gitbook.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ redirects:
7676
user-guide/use-cases/untitled-3: user-guide/use-cases/connect-django-with-mysql-database.md
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
79-
79+
user-guide/clusters: user-guide/resource-browser.md
80+
usage/clusters: user-guide/resource-browser.md

App.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright (c) 2020 Devtron Labs
2+
* Copyright (c) 2020-2024. Devtron Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716

1817
package main

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+

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@ test-unit:
4040
go test ./pkg/pipeline
4141

4242
test-integration:
43-
export INTEGRATION_TEST_ENV_ID=$(docker run --env TEST_BRANCH=$TEST_BRANCH --env LATEST_HASH=$LATEST_HASH --privileged -d --name dind-test -v $PWD/tests/integrationTesting/:/tmp/ docker:dind)
44-
docker exec ${INTEGRATION_TEST_ENV_ID} sh /tmp/create-test-env.sh
45-
docker exec ${INTEGRATION_TEST_ENV_ID} sh /tests/integrationTesting/run-integration-test.sh
46-
43+
docker run --env-file=wireNilChecker.env --privileged -d --name dind-test -v $(PWD)/:/wirenil/:ro -v $(PWD)/temp/:/tempfile docker:dind
44+
docker exec dind-test sh -c "mkdir test && cp -r wirenil/* test/ && ./test/tests/integrationTesting/exportEnvsExecuteWireNilChecker.sh"
4745
run: build
4846
./devtron
49-
5047
.PHONY: build
5148
docker-build-image: build
5249
docker build -t devtron:$(TAG) .
53-
5450
.PHONY: build, all, wire, clean, run, set-docker-build-env, docker-build-push, devtron,
5551
docker-build-push: docker-build-image
5652
docker tag devtron:${TAG} ${REGISTRY}/devtron:${TAG}

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: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
// +build wireinject
33

44
/*
5-
* Copyright (c) 2020 Devtron Labs
5+
* Copyright (c) 2024. Devtron Inc.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
1010
*
11-
* http://www.apache.org/licenses/LICENSE-2.0
11+
* http://www.apache.org/licenses/LICENSE-2.0
1212
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
18-
*
1918
*/
2019

2120
package main
@@ -40,6 +39,7 @@ import (
4039
"github.com/devtron-labs/devtron/api/connector"
4140
"github.com/devtron-labs/devtron/api/dashboardEvent"
4241
"github.com/devtron-labs/devtron/api/deployment"
42+
"github.com/devtron-labs/devtron/api/devtronResource"
4343
"github.com/devtron-labs/devtron/api/externalLink"
4444
client "github.com/devtron-labs/devtron/api/helm-app"
4545
"github.com/devtron-labs/devtron/api/infraConfig"
@@ -122,8 +122,6 @@ import (
122122
deployment2 "github.com/devtron-labs/devtron/pkg/deployment"
123123
git2 "github.com/devtron-labs/devtron/pkg/deployment/gitOps/git"
124124
"github.com/devtron-labs/devtron/pkg/deploymentGroup"
125-
"github.com/devtron-labs/devtron/pkg/devtronResource"
126-
repository9 "github.com/devtron-labs/devtron/pkg/devtronResource/repository"
127125
"github.com/devtron-labs/devtron/pkg/dockerRegistry"
128126
"github.com/devtron-labs/devtron/pkg/eventProcessor"
129127
"github.com/devtron-labs/devtron/pkg/generateManifest"
@@ -196,6 +194,9 @@ func InitializeApp() (*App, error) {
196194

197195
eventProcessor.EventProcessorWireSet,
198196
workflow3.WorkflowWireSet,
197+
198+
devtronResource.DevtronResourceWireSet,
199+
199200
// -------wireset end ----------
200201
// -------
201202
gitSensor.GetConfig,
@@ -749,6 +750,7 @@ func InitializeApp() (*App, error) {
749750

750751
app.NewAppCrudOperationServiceImpl,
751752
wire.Bind(new(app.AppCrudOperationService), new(*app.AppCrudOperationServiceImpl)),
753+
app.GetCrudOperationServiceConfig,
752754
pipelineConfig.NewAppLabelRepositoryImpl,
753755
wire.Bind(new(pipelineConfig.AppLabelRepository), new(*pipelineConfig.AppLabelRepositoryImpl)),
754756

@@ -951,12 +953,6 @@ func InitializeApp() (*App, error) {
951953
resourceQualifiers.NewQualifierMappingServiceImpl,
952954
wire.Bind(new(resourceQualifiers.QualifierMappingService), new(*resourceQualifiers.QualifierMappingServiceImpl)),
953955

954-
repository9.NewDevtronResourceSearchableKeyRepositoryImpl,
955-
wire.Bind(new(repository9.DevtronResourceSearchableKeyRepository), new(*repository9.DevtronResourceSearchableKeyRepositoryImpl)),
956-
957-
devtronResource.NewDevtronResourceSearchableKeyServiceImpl,
958-
wire.Bind(new(devtronResource.DevtronResourceSearchableKeyService), new(*devtronResource.DevtronResourceSearchableKeyServiceImpl)),
959-
960956
argocdServer.NewArgoClientWrapperServiceImpl,
961957
wire.Bind(new(argocdServer.ArgoClientWrapperService), new(*argocdServer.ArgoClientWrapperServiceImpl)),
962958

WiringNilCheck.go

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* Copyright (c) 2024. Devtron Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"fmt"
21+
"log"
22+
"os"
23+
"reflect"
24+
"strings"
25+
"unsafe"
26+
)
27+
28+
func CheckIfNilInWire() {
29+
app, err := InitializeApp()
30+
if err != nil {
31+
log.Panic(err)
32+
}
33+
nilFieldsMap := make(map[string]bool)
34+
checkNilFields(app, nilFieldsMap)
35+
fmt.Println("NIL Fields present in impls are: ", nilFieldsMap)
36+
//Writes the length of nilFieldsMap to a file (e.g., output.env) so that we can export this file's data in a pre-CI pipeline bash script and fail the pre-CI pipeline if the length of nilFieldsMap is greater than zero.
37+
err = writeResultToFile(len(nilFieldsMap))
38+
if err != nil {
39+
return
40+
}
41+
}
42+
43+
func checkNilFields(obj interface{}, nilObjMap map[string]bool) {
44+
val := reflect.ValueOf(obj)
45+
if val.Kind() == reflect.Ptr {
46+
val = val.Elem()
47+
}
48+
if val.Kind() != reflect.Struct {
49+
return
50+
}
51+
valName := val.Type().Name()
52+
for i := 0; i < val.NumField(); i++ {
53+
field := val.Field(i)
54+
fieldName := val.Type().Field(i).Name
55+
pkgPath := val.Type().PkgPath()
56+
if pkgPath != "main" && !strings.Contains(pkgPath, "devtron-labs/devtron") {
57+
//package not from this repo, ignoring
58+
continue
59+
}
60+
if skipUnnecessaryFieldsForCheck(fieldName, valName) { // skip unnecessary fileds and values
61+
continue
62+
}
63+
if !canFieldTypeBeNil(field) { // field can not be nil, skip
64+
continue
65+
} else if field.IsNil() { // check if the field is nil
66+
mapEntry := fmt.Sprintf("%s.%s", valName, fieldName)
67+
nilObjMap[mapEntry] = true
68+
continue
69+
}
70+
if canSkipFieldStructCheck(fieldName, valName) {
71+
continue
72+
}
73+
if !isExported(fieldName) && !field.CanInterface() {
74+
unexportedField := GetUnexportedField(field)
75+
checkNilFields(unexportedField, nilObjMap)
76+
} else {
77+
// Recurse
78+
checkNilFields(field.Interface(), nilObjMap)
79+
}
80+
}
81+
}
82+
83+
func canFieldTypeBeNil(field reflect.Value) bool {
84+
kind := field.Kind()
85+
switch kind {
86+
case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer,
87+
reflect.Interface, reflect.Slice:
88+
return true
89+
default: //other types can not be nil
90+
return false
91+
}
92+
}
93+
94+
func canSkipFieldStructCheck(fieldName, valName string) bool {
95+
fieldName = strings.ToLower(fieldName)
96+
valName = strings.ToLower(valName)
97+
if valName == "githubclient" && (fieldName == "client" || fieldName == "gitopshelper") {
98+
return true
99+
}
100+
for _, str := range []string{"logger", "dbconnection", "syncedenforcer"} {
101+
if fieldName == str {
102+
return true
103+
}
104+
}
105+
return false
106+
}
107+
108+
func skipUnnecessaryFieldsForCheck(fieldName, valName string) bool {
109+
fieldName = strings.ToLower(fieldName)
110+
valName = strings.ToLower(valName)
111+
if valName == "cicdconfig" {
112+
return true
113+
}
114+
fieldAndValName := map[string][]string{
115+
"app": {"enforcerv2", "server"},
116+
"gitfactory": {"client"},
117+
"argocdconnectionmanagerimpl": {"argocdsettings"},
118+
"enforcerimpl": {"cache", "enforcerv2"},
119+
"helmappclientimpl": {"applicationserviceclient"},
120+
"modulecronserviceimpl": {"cron"},
121+
"oteltracingserviceimpl": {"traceprovider"},
122+
"terminalaccessrepositoryimpl": {"templatescache"},
123+
}
124+
if _, ok := fieldAndValName[valName]; ok {
125+
for _, ignoreFieldName := range fieldAndValName[valName] {
126+
if ignoreFieldName == fieldName {
127+
return true
128+
}
129+
}
130+
}
131+
return false
132+
}
133+
func GetUnexportedField(field reflect.Value) interface{} {
134+
return reflect.NewAt(field.Type(), unsafe.Pointer(field.UnsafeAddr())).Elem().Interface()
135+
}
136+
137+
func isExported(fieldName string) bool {
138+
return strings.ToUpper(fieldName[0:1]) == fieldName[0:1]
139+
}
140+
141+
func writeResultToFile(data int) error {
142+
file, err := os.Create("/test/output.env")
143+
if err != nil {
144+
log.Println("Failed to create file:", err)
145+
return err
146+
}
147+
defer file.Close()
148+
_, err = file.WriteString(fmt.Sprintf("OUTPUT=%d", data))
149+
if err != nil {
150+
log.Println("Failed to write to file:", err)
151+
return err
152+
}
153+
return nil
154+
}

api/apiToken/ApiTokenRestHandler.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright (c) 2020 Devtron Labs
2+
* Copyright (c) 2020-2024. Devtron Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716

1817
package apiToken

0 commit comments

Comments
 (0)