diff --git a/common/constants.go b/common/constants.go index a7fb2ff3f..9d8528203 100644 --- a/common/constants.go +++ b/common/constants.go @@ -155,6 +155,8 @@ const ( ConfigCICDTektonGitRepoBasicAuthSecretNameKey = ConfigCICDTektonKey + d + "gitrepobasicauthsecret" // ConfigCICDTektonRegistryPushSecretNameKey is for Tekton push image to registry credentials ConfigCICDTektonRegistryPushSecretNameKey = ConfigCICDTektonKey + d + "registrypushsecret" + //ConfigCICDArgoDestinationNameSpace gives the user input namespace destination + ConfigCICDArgoDestinationNameSpace = "destnamespace" //ConfigTargetExistingVersionUpdate represents key which how to update versions ConfigTargetExistingVersionUpdate = ConfigTargetKey + d + "existingversionupdate" //ConfigImageRegistryURLKey represents image registry url Key diff --git a/transformer/kubernetes/apiresource/argocdapplication.go b/transformer/kubernetes/apiresource/argocdapplication.go index 80f41c078..a3166bfcb 100644 --- a/transformer/kubernetes/apiresource/argocdapplication.go +++ b/transformer/kubernetes/apiresource/argocdapplication.go @@ -19,6 +19,7 @@ package apiresource import ( "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/konveyor/move2kube/common" + "github.com/konveyor/move2kube/qaengine" collecttypes "github.com/konveyor/move2kube/types/collection" irtypes "github.com/konveyor/move2kube/types/ir" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -70,6 +71,16 @@ func (*ArgoCDApplication) createNewResource(irApplication irtypes.Application, t clusterServer = deployToSameCluster } appGVK := v1alpha1.ApplicationSchemaGroupVersionKind + destNamespace := qaengine.FetchStringAnswer( + common.ConfigCICDArgoDestinationNameSpace, + "Enter the destination namespace for argo cd pipeline", + []string{}, + "", + nil, + ) + if destNamespace == "" { + destNamespace = irApplication.DestNamespace + } return &v1alpha1.Application{ TypeMeta: metav1.TypeMeta{APIVersion: appGVK.GroupVersion().String(), Kind: appGVK.Kind}, ObjectMeta: metav1.ObjectMeta{Name: irApplication.Name, Namespace: argoCDNameSpace}, @@ -81,7 +92,7 @@ func (*ArgoCDApplication) createNewResource(irApplication irtypes.Application, t }, Destination: v1alpha1.ApplicationDestination{ Server: clusterServer, - Namespace: irApplication.DestNamespace, + Namespace: destNamespace, }, }, }