Skip to content

Commit 8a977ee

Browse files
committed
merged with main
2 parents 4c0b0fd + 15676fe commit 8a977ee

File tree

117 files changed

+9765
-1136
lines changed

Some content is hidden

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

117 files changed

+9765
-1136
lines changed

.github/semantic.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
titleOnly: true
22

33
types:
4-
- fix:
5-
- feat:
6-
- feature:
7-
- fixes:
8-
- chore:
9-
- perf:
10-
- docs:
11-
- doc:
12-
- release:
4+
- fix
5+
- feat
6+
- feature
7+
- fixes
8+
- chore
9+
- perf
10+
- docs
11+
- doc
12+
- release

CHANGELOG/release-notes-v0.6.9.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## v0.6.9
2+
3+
## Bugs
4+
- fix: specific error message if token is invalid while saving cluster (#2760)
5+
## Enhancements
6+
- feat: Resource status for integration (#2620)
7+
- feat: Cluster terminal access for Super Admins (#2654)
8+
- feat: Dynamic handling of deployment templates (#2596)
9+
## Documentation
10+
- docs: description for charts (#2646)
11+
12+
13+
## v0.6.9-rc.1
14+
15+
## Bugs
16+
- fix: Ignoring propagating invalid labels in app to values.yaml during deployment (#2734)
17+
- fix: app clone response update for empty material and templates (#2717)
18+
- fix: getting error message on deleting linked ci pipeline (#2732)
19+
## Enhancements
20+
- feat: Gitops or helm options for cd (#2673)
21+
- feat: added BE support for allowing insecure tls connection in gitOps (#2738)
22+
## Documentation
23+
- docs: minor updates (#2)
24+
- docs: webhook updates links (#2716)
25+
- docs: webhook ci documentation updates (#2637)
26+
- docs: add getting started doc (#2658)
27+
- docs: broken links fixed (#2741)
28+
## Others
29+
- minor updates (#2722)
30+
- fix for app type setting (#2723)
31+
- task: updated environment variables in pre/post cd workflow request (#2727)
32+
- Revert "feat: added BE support for allowing insecure tls connection in gitOps (#2738)" (#2739)
33+
- minor updates (#2742)
34+
35+
36+
## v0.6.9-rc.0
37+
38+
## Bugs
39+
- fix: removed required validation for deployment template (#2713)
40+
- fix: env variable tag bug in ci cd config (#2698)
41+
- fix: Block deletion of devtronapp(devtron-operator chart) in helm apps (#2701)
42+
- fix: migration down sql for 84 (#2706)
43+
- Fix: Skip external ci webhook clone while app clone (#2704)
44+
- fix: deployment template editor view support in create app api (#2697)
45+
- Fix: External ci webhook response for api token. (#2699)
46+
- fix: wf deletion bug and bulk cd pipeline req (#2693)
47+
- fix: updated cluster connection status for update api (#2686)
48+
## Enhancements
49+
- Feat: External Ci webhook new interface, Deployment separated from build node. (#2664)
50+
## Documentation
51+
- docs: external-links-docs (#2679)
52+
## Others
53+
- sql migration error fix (#2695)
54+
- External links extention for app level (#2573)
55+
- added support for giving names in wf bulk deletion req (#2690)
56+
57+

Wire.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
"github.com/devtron-labs/devtron/api/sse"
4444
"github.com/devtron-labs/devtron/api/sso"
4545
"github.com/devtron-labs/devtron/api/team"
46+
"github.com/devtron-labs/devtron/api/terminal"
4647
"github.com/devtron-labs/devtron/api/user"
4748
webhookHelm "github.com/devtron-labs/devtron/api/webhook/helm"
4849
"github.com/devtron-labs/devtron/client/argocdServer"
@@ -132,6 +133,7 @@ func InitializeApp() (*App, error) {
132133
module.ModuleWireSet,
133134
apiToken.ApiTokenWireSet,
134135
webhookHelm.WebhookHelmWireSet,
136+
terminal.TerminalWireSet,
135137
// -------wireset end ----------
136138
gitSensor.GetGitSensorConfig,
137139
gitSensor.NewGitSensorSession,
@@ -781,6 +783,11 @@ func InitializeApp() (*App, error) {
781783
wire.Bind(new(pipeline.GlobalCMCSService), new(*pipeline.GlobalCMCSServiceImpl)),
782784
repository.NewGlobalCMCSRepositoryImpl,
783785
wire.Bind(new(repository.GlobalCMCSRepository), new(*repository.GlobalCMCSRepositoryImpl)),
786+
787+
chartRepoRepository.NewGlobalStrategyMetadataRepositoryImpl,
788+
wire.Bind(new(chartRepoRepository.GlobalStrategyMetadataRepository), new(*chartRepoRepository.GlobalStrategyMetadataRepositoryImpl)),
789+
chartRepoRepository.NewGlobalStrategyMetadataChartRefMappingRepositoryImpl,
790+
wire.Bind(new(chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepository), new(*chartRepoRepository.GlobalStrategyMetadataChartRefMappingRepositoryImpl)),
784791
)
785792
return &App{}, nil
786793
}

api/appbean/AppDetail.go

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package appbean
33
import (
44
"github.com/devtron-labs/devtron/internal/sql/models"
55
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
6+
"github.com/devtron-labs/devtron/pkg/chartRepo/repository"
67
"github.com/devtron-labs/devtron/pkg/pipeline/bean"
78
)
89

@@ -100,24 +101,24 @@ type BuildScript struct {
100101
}
101102

102103
type CdPipelineDetails struct {
103-
Name string `json:"name"` //pipelineName
104-
EnvironmentName string `json:"environmentName" `
105-
TriggerType pipelineConfig.TriggerType `json:"triggerType" validate:"required"`
106-
DeploymentType pipelineConfig.DeploymentTemplate `json:"deploymentType,omitempty" validate:"oneof=BLUE-GREEN ROLLING CANARY RECREATE"` //
107-
DeploymentStrategies []*DeploymentStrategy `json:"deploymentStrategies"`
108-
PreStage *CdStage `json:"preStage"`
109-
PostStage *CdStage `json:"postStage"`
110-
PreStageConfigMapSecretNames *CdStageConfigMapSecretNames `json:"preStageConfigMapSecretNames"`
111-
PostStageConfigMapSecretNames *CdStageConfigMapSecretNames `json:"postStageConfigMapSecretNames"`
112-
RunPreStageInEnv bool `json:"runPreStageInEnv"`
113-
RunPostStageInEnv bool `json:"runPostStageInEnv"`
114-
IsClusterCdActive bool `json:"isClusterCdActive"`
104+
Name string `json:"name"` //pipelineName
105+
EnvironmentName string `json:"environmentName" `
106+
TriggerType pipelineConfig.TriggerType `json:"triggerType" validate:"required"`
107+
DeploymentStrategyType chartRepoRepository.DeploymentStrategy `json:"deploymentType,omitempty"` //
108+
DeploymentStrategies []*DeploymentStrategy `json:"deploymentStrategies"`
109+
PreStage *CdStage `json:"preStage"`
110+
PostStage *CdStage `json:"postStage"`
111+
PreStageConfigMapSecretNames *CdStageConfigMapSecretNames `json:"preStageConfigMapSecretNames"`
112+
PostStageConfigMapSecretNames *CdStageConfigMapSecretNames `json:"postStageConfigMapSecretNames"`
113+
RunPreStageInEnv bool `json:"runPreStageInEnv"`
114+
RunPostStageInEnv bool `json:"runPostStageInEnv"`
115+
IsClusterCdActive bool `json:"isClusterCdActive"`
115116
}
116117

117118
type DeploymentStrategy struct {
118-
DeploymentType pipelineConfig.DeploymentTemplate `json:"deploymentType,omitempty" validate:"oneof=BLUE-GREEN ROLLING CANARY RECREATE"` //
119-
Config map[string]interface{} `json:"config,omitempty" validate:"string"`
120-
IsDefault bool `json:"isDefault" validate:"required"`
119+
DeploymentStrategyType chartRepoRepository.DeploymentStrategy `json:"deploymentType,omitempty"` //
120+
Config map[string]interface{} `json:"config,omitempty" validate:"string"`
121+
IsDefault bool `json:"isDefault" validate:"required"`
121122
}
122123

123124
type CdStage struct {

api/cluster/ClusterRestHandler.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type ClusterRestHandler interface {
5151

5252
FindAllForAutoComplete(w http.ResponseWriter, r *http.Request)
5353
DeleteCluster(w http.ResponseWriter, r *http.Request)
54+
GetAllClusterNamespaces(w http.ResponseWriter, r *http.Request)
5455
}
5556

5657
type ClusterRestHandlerImpl struct {
@@ -360,3 +361,18 @@ func (impl ClusterRestHandlerImpl) DeleteCluster(w http.ResponseWriter, r *http.
360361
}
361362
common.WriteJsonResp(w, err, CLUSTER_DELETE_SUCCESS_RESP, http.StatusOK)
362363
}
364+
365+
func (impl ClusterRestHandlerImpl) GetAllClusterNamespaces(w http.ResponseWriter, r *http.Request) {
366+
token := r.Header.Get("token")
367+
clusterNamespaces := impl.clusterService.GetAllClusterNamespaces()
368+
369+
// RBAC enforcer applying
370+
for clusterName, _ := range clusterNamespaces {
371+
if ok := impl.enforcer.Enforce(token, casbin.ResourceCluster, casbin.ActionGet, strings.ToLower(clusterName)); !ok {
372+
delete(clusterNamespaces, clusterName)
373+
}
374+
}
375+
//RBAC enforcer Ends
376+
377+
common.WriteJsonResp(w, nil, clusterNamespaces, http.StatusOK)
378+
}

api/cluster/ClusterRouter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func (impl ClusterRouterImpl) InitClusterRouter(clusterRouter *mux.Router) {
5757
Methods("GET").
5858
HandlerFunc(impl.clusterRestHandler.FindAllForAutoComplete)
5959

60+
clusterRouter.Path("/namespaces").
61+
Methods("GET").
62+
HandlerFunc(impl.clusterRestHandler.GetAllClusterNamespaces)
63+
6064
clusterRouter.Path("").
6165
Methods("DELETE").
6266
HandlerFunc(impl.clusterRestHandler.DeleteCluster)

api/helm-app/HelmAppService.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const DEFAULT_CLUSTER_ID = 1
3737
type HelmAppService interface {
3838
ListHelmApplications(clusterIds []int, w http.ResponseWriter, token string, helmAuth func(token string, object string) bool)
3939
GetApplicationDetail(ctx context.Context, app *AppIdentifier) (*AppDetail, error)
40+
GetApplicationDetailWithFilter(ctx context.Context, app *AppIdentifier, resourceTreeFilter *ResourceTreeFilter) (*AppDetail, error)
4041
HibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
4142
UnHibernateApplication(ctx context.Context, app *AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
4243
DecodeAppId(appId string) (*AppIdentifier, error)
@@ -233,15 +234,24 @@ func (impl *HelmAppServiceImpl) GetClusterConf(clusterId int) (*ClusterConfig, e
233234
}
234235

235236
func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *AppIdentifier) (*AppDetail, error) {
237+
return impl.getApplicationDetail(ctx, app, nil)
238+
}
239+
240+
func (impl *HelmAppServiceImpl) GetApplicationDetailWithFilter(ctx context.Context, app *AppIdentifier, resourceTreeFilter *ResourceTreeFilter) (*AppDetail, error) {
241+
return impl.getApplicationDetail(ctx, app, resourceTreeFilter)
242+
}
243+
244+
func (impl *HelmAppServiceImpl) getApplicationDetail(ctx context.Context, app *AppIdentifier, resourceTreeFilter *ResourceTreeFilter) (*AppDetail, error) {
236245
config, err := impl.GetClusterConf(app.ClusterId)
237246
if err != nil {
238247
impl.logger.Errorw("error in fetching cluster detail", "err", err)
239248
return nil, err
240249
}
241250
req := &AppDetailRequest{
242-
ClusterConfig: config,
243-
Namespace: app.Namespace,
244-
ReleaseName: app.ReleaseName,
251+
ClusterConfig: config,
252+
Namespace: app.Namespace,
253+
ReleaseName: app.ReleaseName,
254+
ResourceTreeFilter: resourceTreeFilter,
245255
}
246256
appdetail, err := impl.helmAppClient.GetAppDetail(ctx, req)
247257
if err != nil {
@@ -265,7 +275,6 @@ func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *A
265275
}
266276
}
267277
return appdetail, err
268-
269278
}
270279

271280
func (impl *HelmAppServiceImpl) GetDeploymentHistory(ctx context.Context, app *AppIdentifier) (*HelmAppDeploymentHistory, error) {

0 commit comments

Comments
 (0)