Skip to content

Commit

Permalink
Enhanced: Added an input recieveing option to recieve an input for ar…
Browse files Browse the repository at this point in the history
…gocd

Signed-off-by: Md Sahil <[email protected]>
  • Loading branch information
MdSahil-oss committed Aug 2, 2023
1 parent 817b8c9 commit 460a46b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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
23 changes: 21 additions & 2 deletions transformer/kubernetes/argocdtransformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/konveyor/move2kube/common"
"github.com/konveyor/move2kube/environment"
"github.com/konveyor/move2kube/qaengine"
"github.com/konveyor/move2kube/transformer/kubernetes/apiresource"
"github.com/konveyor/move2kube/transformer/kubernetes/irpreprocessor"
collecttypes "github.com/konveyor/move2kube/types/collection"
Expand Down Expand Up @@ -152,8 +153,26 @@ func (t *ArgoCD) setupEnhancedIR(oldir irtypes.IR, projectName string) irtypes.E
return common.MakeStringDNSSubdomainNameCompliant(fmt.Sprintf("%s-%s", projectName, baseName))
}
appName := p(baseAppName)
ir.ArgoCDResources = irtypes.ArgoCDResources{
Applications: []irtypes.Application{{Name: appName}},
destNamespace := qaengine.FetchStringAnswer(
common.ConfigTransformersKubernetesArgocdNamespaceKey,
"Enter the namespace where argocd pipeline to be deployed",
[]string{"If this is not relevant to you then give an empty string use the default configuration for it."},
"",
nil,
)
if destNamespace == "" {
ir.ArgoCDResources = irtypes.ArgoCDResources{
Applications: []irtypes.Application{{
Name: appName,
}},
}
} else {
ir.ArgoCDResources = irtypes.ArgoCDResources{
Applications: []irtypes.Application{{
Name: appName,
DestNamespace: destNamespace,
}},
}
}
return ir
}

0 comments on commit 460a46b

Please sign in to comment.