Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: take destNamespace from user #1069

Merged
merged 7 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ const (
ConfigServicesDotNetChildProjectsNamesKey = ConfigServicesKey + d + "%s" + d + "childProjects" + d + Special + d + "enable"
// ConfigServicesChildModulesSpringProfilesKey is the list of spring profiles for this child module. 1st arg is service name and 2nd is child module name.
ConfigServicesChildModulesSpringProfilesKey = ConfigServicesKey + d + "%s" + d + "childModules" + d + "%s" + d + "springBootProfiles"
// ConfigTransformersKubernetesArgoCDNamespaceKey represents namespace key for argocd transformer
ConfigTransformersKubernetesArgoCDNamespaceKey = ConfigTransformersKey + d + "kubernetes" + d + "argocd" + d + "namespace"
//VCSKey represents version control system key
VCSKey = BaseKey + d + "vcs"
//GitKey represents git qa key
Expand Down
11 changes: 10 additions & 1 deletion transformer/kubernetes/apiresource/argocdapplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -70,6 +71,14 @@ func (*ArgoCDApplication) createNewResource(irApplication irtypes.Application, t
clusterServer = deployToSameCluster
}
appGVK := v1alpha1.ApplicationSchemaGroupVersionKind
ques := qaengine.FetchStringAnswer(
SVKREP marked this conversation as resolved.
Show resolved Hide resolved
common.ConfigTransformersKubernetesArgoCDNamespaceKey,
"Enter destination namespace for argo cd pipeline",
SVKREP marked this conversation as resolved.
Show resolved Hide resolved
[]string{"If this is not relevant to you then give an empty string to remove it from the YAML."},
SVKREP marked this conversation as resolved.
Show resolved Hide resolved
"",
nil,
)
destNamespace := ques
return &v1alpha1.Application{
TypeMeta: metav1.TypeMeta{APIVersion: appGVK.GroupVersion().String(), Kind: appGVK.Kind},
ObjectMeta: metav1.ObjectMeta{Name: irApplication.Name, Namespace: argoCDNameSpace},
Expand All @@ -81,7 +90,7 @@ func (*ArgoCDApplication) createNewResource(irApplication irtypes.Application, t
},
Destination: v1alpha1.ApplicationDestination{
Server: clusterServer,
Namespace: irApplication.DestNamespace,
Namespace: destNamespace,
},
},
}
Expand Down