Skip to content

Commit fa3b9d4

Browse files
authored
Merge branch 'develop' into notifier-refac
2 parents 000bd42 + edc0f6a commit fa3b9d4

File tree

11 files changed

+897
-693
lines changed

11 files changed

+897
-693
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ require (
307307

308308
replace (
309309
github.com/argoproj/argo-workflows/v3 v3.5.13 => github.com/devtron-labs/argo-workflows/v3 v3.5.13
310-
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522103151-bbd74bc17b49
311-
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522103151-bbd74bc17b49
310+
github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522104903-ba0d761f14a3
311+
github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522104903-ba0d761f14a3
312312
github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127
313313
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5
314314
k8s.io/api => k8s.io/api v0.29.7

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -829,10 +829,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq
829829
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
830830
github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU=
831831
github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA=
832-
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522103151-bbd74bc17b49 h1:OrLZfLXifIHOewjANdNsiwGAU38L26aTEbR6RJ0yr1c=
833-
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522103151-bbd74bc17b49/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ=
834-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522103151-bbd74bc17b49 h1:75n5bnZURneI2ileon0/PN2gQNorhUIzhQ7Jz7qgHTM=
835-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522103151-bbd74bc17b49/go.mod h1:CXQGEo+kZc7JPX5hn4jJf1msal9q/ExSdAYGkHNPnQw=
832+
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522104903-ba0d761f14a3 h1:YJDD0cAB88y8NaTf1L10lrWavjRz9wTUVVBLk3dZeHI=
833+
github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250522104903-ba0d761f14a3/go.mod h1:FfaLDXN1ZXxyRpnskBqVIYkpkWDCzBmDgIO9xqLnxdQ=
834+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522104903-ba0d761f14a3 h1:Tms2vTi1npEHJtHf0RtqD9xBQNkCP3J0xMNXGzKSIOA=
835+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250522104903-ba0d761f14a3/go.mod h1:HQVUnQI7WHwVq89Bib/18xJqM89S1+xI0O7REctMMrA=
836836
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
837837
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
838838
github.com/devtron-labs/protos v0.0.3-0.20250323220609-ecf8a0f7305e h1:U6UdYbW8a7xn5IzFPd8cywjVVPfutGJCudjePAfL/Hs=

pkg/pipeline/CiCdPipelineOrchestrator.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,20 @@ func (impl CiCdPipelineOrchestratorImpl) DeleteApp(appId int, userId int32) erro
13691369
}
13701370
// Rollback tx on error.
13711371
defer tx.Rollback()
1372+
// deleting deployment config first as it is dependent on app
1373+
appDeploymentConfig, err := impl.deploymentConfigService.GetAndMigrateConfigIfAbsentForDevtronApps(appId, 0)
1374+
if err != nil && !errors.Is(err, pg.ErrNoRows) {
1375+
impl.logger.Errorw("error in fetching environment deployment config by appId and envId", "appId", appId, "err", err)
1376+
return err
1377+
} else if err == nil && appDeploymentConfig != nil {
1378+
appDeploymentConfig.Active = false
1379+
appDeploymentConfig, err = impl.deploymentConfigService.CreateOrUpdateConfig(tx, appDeploymentConfig, userId)
1380+
if err != nil {
1381+
impl.logger.Errorw("error in deleting deployment config for pipeline", "appId", appId, "err", err)
1382+
return err
1383+
}
1384+
}
1385+
// deleting app
13721386
app.Active = false
13731387
app.UpdatedOn = time.Now()
13741388
app.UpdatedBy = userId
@@ -1383,18 +1397,6 @@ func (impl CiCdPipelineOrchestratorImpl) DeleteApp(appId int, userId int32) erro
13831397
impl.logger.Errorw("error in deleting auth roles", "err", err)
13841398
return err
13851399
}
1386-
appDeploymentConfig, err := impl.deploymentConfigService.GetAndMigrateConfigIfAbsentForDevtronApps(appId, 0)
1387-
if err != nil && !errors.Is(err, pg.ErrNoRows) {
1388-
impl.logger.Errorw("error in fetching environment deployment config by appId and envId", "appId", appId, "err", err)
1389-
return err
1390-
} else if err == nil && appDeploymentConfig != nil {
1391-
appDeploymentConfig.Active = false
1392-
appDeploymentConfig, err = impl.deploymentConfigService.CreateOrUpdateConfig(tx, appDeploymentConfig, userId)
1393-
if err != nil {
1394-
impl.logger.Errorw("error in deleting deployment config for pipeline", "appId", appId, "err", err)
1395-
return err
1396-
}
1397-
}
13981400
err = tx.Commit()
13991401
if err != nil {
14001402
return err

pkg/terminal/terminalSesion.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package terminal
1718

1819
import (
@@ -566,23 +567,17 @@ func (impl *TerminalSessionHandlerImpl) getClientSetAndRestConfigForTerminalConn
566567
}
567568

568569
clusterConfig = clusterBean.GetClusterConfig()
569-
restConfig, err = impl.k8sUtil.GetRestConfigByCluster(clusterConfig)
570+
restConfig, err = impl.k8sUtil.GetRestConfigByCluster(clusterConfig, k8s.WithDefaultHttpTransport())
570571
if err != nil {
571572
impl.logger.Errorw("error in getting rest config by cluster", "err", err, "clusterName", clusterConfig.ClusterName)
572573
return nil, nil, err
573574
}
574575

575-
_, clientSet, err := impl.k8sUtil.GetK8sConfigAndClientsByRestConfig(restConfig)
576+
_, clientSet, err := impl.k8sUtil.GetK8sConfigAndClientsByRestConfig(restConfig, k8s.WithDefaultHttpTransport())
576577
if err != nil {
577578
impl.logger.Errorw("error in clientSet", "err", err)
578579
return nil, nil, err
579580
}
580-
581-
// we have to get the clientSet before setting the custom transport to nil
582-
// we need re populate the tls config in the restConfig.
583-
// rest config with custom transport will break spdy client
584-
clusterConfig.PopulateTlsConfigurationsInto(restConfig)
585-
restConfig.Transport = nil
586581
return restConfig, clientSet, nil
587582
}
588583
}

vendor/github.com/devtron-labs/common-lib/utils/k8s/HttpTansport.go

Lines changed: 129 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)