Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import (
"fmt"
"strconv"
"time"

"github.com/devtron-labs/common-lib/utils/k8s/health"
"github.com/devtron-labs/devtron/internal/sql/repository/app"
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig/bean/timelineStatus"
Expand All @@ -34,8 +37,6 @@
"github.com/go-pg/pg"
"github.com/go-pg/pg/orm"
"go.uber.org/zap"
"strconv"
"time"
)

// InstalledApps TODO: remove the deprecated column GitOpsRepoName
Expand Down Expand Up @@ -765,7 +766,7 @@
var installedApps []*InstalledApps
err := impl.dbConnection.
Model(&installedApps).
Column("installed_apps.id", "App.app_name", "App.display_name", "Environment.cluster_id", "Environment.namespace").
Column("installed_apps.id", "App.app_name", "App.display_name", "Environment.cluster_id", "Environment.namespace", "Environment.environment_name").

Check failure on line 769 in pkg/appStore/installedApp/repository/InstalledAppRepository.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "App.app_name" 3 times.

See more on https://sonarcloud.io/project/issues?id=devtron-labs_devtron&issues=AZ7vXsrQTbZMs_bFzb6Z&open=AZ7vXsrQTbZMs_bFzb6Z&pullRequest=6969

Check failure on line 769 in pkg/appStore/installedApp/repository/InstalledAppRepository.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "Environment.environment_name" 3 times.

See more on https://sonarcloud.io/project/issues?id=devtron-labs_devtron&issues=AZ7vXsrQTbZMs_bFzb6a&open=AZ7vXsrQTbZMs_bFzb6a&pullRequest=6969
Join("LEFT JOIN deployment_config dc on dc.active=true and dc.app_id = installed_apps.app_id and dc.environment_id=installed_apps.environment_id").
Where("environment.cluster_id in (?)", pg.In(clusterIds)).
Where("(installed_apps.deployment_app_type = ? or dc.deployment_app_type = ?)", deploymentAppType, deploymentAppType).
Expand Down
8 changes: 5 additions & 3 deletions pkg/fluxApplication/FluxApplicationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package fluxApplication
import (
"context"
"fmt"
"io"
"net/http"

"github.com/devtron-labs/common-lib/utils/k8s/commonBean"
"github.com/devtron-labs/devtron/api/connector"
"github.com/devtron-labs/devtron/api/helm-app/gRPC"
Expand All @@ -15,12 +18,11 @@ import (
"github.com/devtron-labs/devtron/pkg/appStore/installedApp/repository"
"github.com/devtron-labs/devtron/pkg/cluster"
"github.com/devtron-labs/devtron/pkg/fluxApplication/bean"
util2 "github.com/devtron-labs/devtron/util"
"github.com/devtron-labs/devtron/util/sliceUtil"
"github.com/gogo/protobuf/proto"
"go.opentelemetry.io/otel"
"go.uber.org/zap"
"io"
"net/http"
)

type FluxApplicationService interface {
Expand Down Expand Up @@ -126,7 +128,7 @@ func (impl *FluxApplicationServiceImpl) ListFluxApplications(ctx context.Context
if _, ok := installedAppMap[key]; !ok {
installedAppMap[key] = make(map[string]bool)
}
deploymentAppName := fmt.Sprintf("%s-%s", i.App.AppName, i.Environment.Namespace)
deploymentAppName := util2.BuildDeployedAppName(i.App.AppName, i.Environment.Name)
installedAppMap[key][deploymentAppName] = true
}
if !noStream {
Expand Down
Loading