Skip to content
Merged
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
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ require (
require (
github.com/docker/distribution v2.8.2+incompatible
github.com/fluxcd/helm-controller/api v1.3.0
github.com/fluxcd/pkg/apis/meta v1.12.0
github.com/fluxcd/source-controller/api v1.6.0
sigs.k8s.io/controller-runtime v0.21.0
)
Expand Down Expand Up @@ -309,7 +310,6 @@ require (
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fluxcd/pkg/apis/acl v0.7.0 // indirect
github.com/fluxcd/pkg/apis/kustomize v1.10.0 // indirect
github.com/fluxcd/pkg/apis/meta v1.12.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
Expand Down Expand Up @@ -347,5 +347,7 @@ replace (
k8s.io/mount-utils => k8s.io/mount-utils v0.29.7
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.29.7
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.29.7
k8s.io/utils => k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.20.0
sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.17.3
)
17 changes: 6 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,6 @@ github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2C
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.0.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
Expand Down Expand Up @@ -1389,8 +1388,8 @@ github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3Ro
github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0=
github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
Expand All @@ -1411,8 +1410,8 @@ github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRah
github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
Expand Down Expand Up @@ -1500,7 +1499,6 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY=
github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
Expand Down Expand Up @@ -2484,7 +2482,6 @@ k8s.io/component-helpers v0.29.7/go.mod h1:fBB9g4OrGCxo2+px6+kU4BPQ56WnBbL8n2NY6
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/helm v2.12.3+incompatible h1:wo1cdYjOnr5Z+LFuhtwIJaeQnec6D4gcg2H5UAKzY6w=
k8s.io/helm v2.12.3+incompatible/go.mod h1:LZzlS4LQBHfciFOurYBFkCMTaZ0D1l+p0teMg7TSULI=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
Expand All @@ -2502,8 +2499,6 @@ k8s.io/kubernetes v1.29.10 h1:vlze77k0CbdevTbgliyxpSjfI3bvOUhPEJVSJAEUl5Q=
k8s.io/kubernetes v1.29.10/go.mod h1:L6/pfKQZ6Tv2O8gyT4OxhGZp+nNsjV54xtNodRoup9k=
k8s.io/metrics v0.29.7 h1:/oMPdVL7dt+lF8W6lXTg9gIKz1dDKgVBfDnJwgyJrhk=
k8s.io/metrics v0.29.7/go.mod h1:5AiYPn1Crd25wtTh7OxHg9Rm2t9THSXJVp3Lb2k7MB8=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
Expand Down Expand Up @@ -2548,8 +2543,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
sigs.k8s.io/controller-runtime v0.20.0 h1:jjkMo29xEXH+02Md9qaVXfEIaMESSpy3TBWPrsfQkQs=
sigs.k8s.io/controller-runtime v0.20.0/go.mod h1:BrP3w158MwvB3ZbNpaAcIKkHQ7YGpYnzpoSTZ8E14WU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
Expand Down
13 changes: 13 additions & 0 deletions pkg/bean/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ type CDPipelineConfigObject struct {
ReleaseMode string `json:"releaseMode" validate:"omitempty,oneof=link create"`
}

func (cdPipelineConfig *CDPipelineConfigObject) IsFluxDeploymentAppType() bool {
return cdPipelineConfig.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_FLUX
}

func (cdPipelineConfig *CDPipelineConfigObject) IsAcdDeploymentAppType() bool {
return cdPipelineConfig.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_ACD
}

func (cdPipelineConfig *CDPipelineConfigObject) IsLinkedRelease() bool {
return cdPipelineConfig.GetReleaseMode() == util.PIPELINE_RELEASE_MODE_LINK
}
Expand Down Expand Up @@ -706,6 +714,11 @@ func (cdPipelineConfig *CDPipelineConfigObject) IsExternalArgoAppLinkRequest() b
cdPipelineConfig.GetReleaseMode() == util.PIPELINE_RELEASE_MODE_LINK
}

func (cdPipelineConfig *CDPipelineConfigObject) IsExternalFluxAppLinkRequest() bool {
return cdPipelineConfig.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_FLUX &&
cdPipelineConfig.GetReleaseMode() == util.PIPELINE_RELEASE_MODE_LINK
}

func (cdPipelineConfig *CDPipelineConfigObject) IsExternalHelmAppLinkRequest() bool {
return cdPipelineConfig.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_HELM &&
cdPipelineConfig.GetReleaseMode() == util.PIPELINE_RELEASE_MODE_LINK
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/environment/bean/bean.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type ResourceGroupingResponse struct {
const (
PIPELINE_DEPLOYMENT_TYPE_HELM = "helm"
PIPELINE_DEPLOYMENT_TYPE_ACD = "argo_cd"
PIPELINE_DEPLOYMENT_TYPE_FLUX = "flux_cd"
)

type DataSourceMetaData struct {
Expand Down
8 changes: 7 additions & 1 deletion pkg/deployment/common/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@ func NewAppLevelReleaseConfigFromChart(gitRepoURL, chartLocation string) *bean.R
}}
}

func NewFluxSpecReleaseConfig(namespace, gitRepositoryName, helmReleaseName, gitOpsSecretName string) *bean.ReleaseConfiguration {
func NewFluxSpecReleaseConfig(clusterId int, namespace, gitRepositoryName, helmReleaseName, gitOpsSecretName, ChartLocation, ChartVersion, RevisionTarget, RepoUrl string, ValuesFiles []string) *bean.ReleaseConfiguration {
return &bean.ReleaseConfiguration{
Version: bean.Version,
FluxCDSpec: bean.FluxCDSpec{
ClusterId: clusterId,
Namespace: namespace,
GitRepositoryName: gitRepositoryName,
HelmReleaseName: helmReleaseName,
GitOpsSecretName: gitOpsSecretName,
ChartLocation: ChartLocation,
ChartVersion: ChartVersion,
RevisionTarget: RevisionTarget,
RepoUrl: RepoUrl,
ValuesFiles: ValuesFiles,
}}
}

Expand Down
45 changes: 42 additions & 3 deletions pkg/deployment/common/bean/bean.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type ReleaseConfiguration struct {
}

type FluxCDSpec struct {
ClusterId int `json:"clusterId"`
Namespace string `json:"namespace"`
GitRepositoryName string `json:"gitRepositoryName"`
HelmReleaseName string `json:"helmReleaseName"`
Expand Down Expand Up @@ -186,6 +187,10 @@ func (d *DeploymentConfig) IsAcdRelease() bool {
return d.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_ACD
}

func (d *DeploymentConfig) IsFluxRelease() bool {
return d.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_FLUX
}

func (d *DeploymentConfig) IsLinkedRelease() bool {
return d.ReleaseMode == util.PIPELINE_RELEASE_MODE_LINK
}
Expand Down Expand Up @@ -224,13 +229,21 @@ func (d *DeploymentConfig) IsPipelineGitOpsRepoConfigured(isAppLevelGitOpsConfig
}

func (d *DeploymentConfig) GetRepoURL() string {

if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
return d.ReleaseConfiguration.FluxCDSpec.RepoUrl
}

if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
return d.RepoURL
}
return d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.RepoURL
}

func (d *DeploymentConfig) GetTargetRevision() string {
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
return d.ReleaseConfiguration.FluxCDSpec.RevisionTarget
}
if d.ReleaseConfiguration == nil ||
d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil ||
len(d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.TargetRevision) == 0 {
Expand All @@ -239,7 +252,11 @@ func (d *DeploymentConfig) GetTargetRevision() string {
return d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.TargetRevision
}

func (d *DeploymentConfig) GetValuesFilePath() string {
func (d *DeploymentConfig) GetValuesFilePathForCommit() string {
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
// We will commit values in last file of array
return d.ReleaseConfiguration.FluxCDSpec.ValuesFiles[len(d.ReleaseConfiguration.FluxCDSpec.ValuesFiles)-1]
}
if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
return ""
}
Expand All @@ -252,6 +269,9 @@ func (d *DeploymentConfig) GetValuesFilePath() string {
}

func (d *DeploymentConfig) GetChartLocation() string {
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
return d.ReleaseConfiguration.FluxCDSpec.ChartLocation
}
if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
return ""
}
Expand All @@ -260,6 +280,10 @@ func (d *DeploymentConfig) GetChartLocation() string {

func (d *DeploymentConfig) SetRepoURL(repoURL string) *DeploymentConfig {
d.RepoURL = repoURL // maintain for backward compatibility
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
d.ReleaseConfiguration.FluxCDSpec.RepoUrl = repoURL
return d
}
if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
return d
}
Expand All @@ -268,17 +292,32 @@ func (d *DeploymentConfig) SetRepoURL(repoURL string) *DeploymentConfig {
}

func (d *DeploymentConfig) SetChartLocation(chartLocation string) {
if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
d.ReleaseConfiguration.FluxCDSpec.ChartLocation = chartLocation
return
}
if d.ReleaseConfiguration == nil ||
(d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil &&
len(d.ReleaseConfiguration.FluxCDSpec.ChartLocation) == 0) {
return
}
d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.Path = chartLocation
}

func (d *DeploymentConfig) GetRevision() string {
if d.IsFluxRelease() && d.ReleaseConfiguration != nil {
return d.ReleaseConfiguration.FluxCDSpec.RevisionTarget
}

if d.ReleaseConfiguration == nil || d.ReleaseConfiguration.ArgoCDSpec.Spec.Source == nil {
return ""
}
return d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.TargetRevision
if d.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_ACD {
return d.ReleaseConfiguration.ArgoCDSpec.Spec.Source.TargetRevision
} else if d.DeploymentAppType == util.PIPELINE_DEPLOYMENT_TYPE_FLUX {
return d.ReleaseConfiguration.FluxCDSpec.RevisionTarget
}
return ""
}

func (d *DeploymentConfig) GetAcdAppName() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/common/deploymentConfigService.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (impl *DeploymentConfigServiceImpl) UpdateChartLocationInDeploymentConfig(a
impl.logger.Errorw("error, GetConfigForDevtronApps", "appId", appId, "envId", envId, "err", err)
return err
}
if config.ReleaseMode == util2.PIPELINE_RELEASE_MODE_CREATE && config.DeploymentAppType == bean4.PIPELINE_DEPLOYMENT_TYPE_ACD {
if config.ReleaseMode == util2.PIPELINE_RELEASE_MODE_CREATE && (config.IsAcdRelease() || config.IsFluxRelease()) {
chartRef, err := impl.chartRefRepository.FindById(chartRefId)
if err != nil {
impl.logger.Errorw("error in chartRefRepository.FindById", "chartRefId", chartRefId, "err", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (impl *DeploymentTypeOverrideServiceImpl) ValidateAndOverrideDeploymentAppT
AllowedDeploymentAppTypes := map[string]bool{
util2.PIPELINE_DEPLOYMENT_TYPE_ACD: true,
util2.PIPELINE_DEPLOYMENT_TYPE_HELM: true,
util2.PIPELINE_DEPLOYMENT_TYPE_FLUX: true,
}
for k, v := range deploymentTypeValidationConfig {
// rewriting allowed deployment types based on config provided by user
Expand All @@ -72,11 +73,15 @@ func (impl *DeploymentTypeOverrideServiceImpl) ValidateAndOverrideDeploymentAppT
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_ACD
} else if AllowedDeploymentAppTypes[util2.PIPELINE_DEPLOYMENT_TYPE_HELM] {
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_HELM
} else if AllowedDeploymentAppTypes[util2.PIPELINE_DEPLOYMENT_TYPE_FLUX] {
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_FLUX
}
}
if deploymentType == "" {
if isGitOpsConfigured && AllowedDeploymentAppTypes[util2.PIPELINE_DEPLOYMENT_TYPE_ACD] {
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_ACD
} else if isGitOpsConfigured && AllowedDeploymentAppTypes[util2.PIPELINE_DEPLOYMENT_TYPE_FLUX] {
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_FLUX
} else if AllowedDeploymentAppTypes[util2.PIPELINE_DEPLOYMENT_TYPE_HELM] {
overrideDeploymentType = util2.PIPELINE_DEPLOYMENT_TYPE_HELM
}
Expand All @@ -85,7 +90,7 @@ func (impl *DeploymentTypeOverrideServiceImpl) ValidateAndOverrideDeploymentAppT
impl.logger.Errorw("validation error for the given deployment type", "deploymentType", deploymentType, "err", err)
return overrideDeploymentType, err
}
if !isGitOpsConfigured && util2.IsAcdApp(overrideDeploymentType) {
if !isGitOpsConfigured && util2.IsAcdApp(overrideDeploymentType) && util2.IsFluxApp(overrideDeploymentType) {
impl.logger.Errorw("GitOps not configured but selected as a deployment app type")
err = &util2.ApiError{
HttpStatusCode: http.StatusBadRequest,
Expand Down
6 changes: 5 additions & 1 deletion pkg/deployment/trigger/devtronApps/deployStageHandlerCode.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,14 @@ func (impl *HandlerServiceImpl) buildManifestPushTemplate(overrideRequest *bean3
}
}
} else {

manifestPushTemplate.ChartReferenceTemplate = valuesOverrideResponse.EnvOverride.Chart.ReferenceTemplate
manifestPushTemplate.ChartName = valuesOverrideResponse.EnvOverride.Chart.ChartName
manifestPushTemplate.ChartVersion = valuesOverrideResponse.EnvOverride.Chart.ChartVersion
manifestPushTemplate.ChartLocation = valuesOverrideResponse.DeploymentConfig.GetChartLocation()
manifestPushTemplate.RepoUrl = valuesOverrideResponse.DeploymentConfig.GetRepoURL()
manifestPushTemplate.TargetRevision = valuesOverrideResponse.DeploymentConfig.GetTargetRevision()
manifestPushTemplate.ValuesFilePath = valuesOverrideResponse.DeploymentConfig.GetValuesFilePath()
manifestPushTemplate.ValuesFilePath = valuesOverrideResponse.DeploymentConfig.GetValuesFilePathForCommit()
manifestPushTemplate.ReleaseMode = valuesOverrideResponse.DeploymentConfig.ReleaseMode
manifestPushTemplate.IsCustomGitRepository = common.IsCustomGitOpsRepo(valuesOverrideResponse.DeploymentConfig.ConfigType)
manifestPushTemplate.IsArgoSyncSupported = valuesOverrideResponse.DeploymentConfig.IsArgoAppSyncAndRefreshSupported()
Expand Down Expand Up @@ -1267,6 +1268,9 @@ func (impl *HandlerServiceImpl) isDevtronAsyncInstallModeEnabled(overrideRequest
} else if util.IsAcdApp(overrideRequest.DeploymentAppType) {
return impl.isDevtronAsyncArgoCdInstallModeEnabledForApp(overrideRequest.AppId,
overrideRequest.EnvId, overrideRequest.ForceSyncDeployment)
} else if util.IsFluxApp(overrideRequest.DeploymentAppType) {
// will need sanity and testing around flux cd
return false, nil
}
return false, nil
}
Expand Down
Loading