-
Notifications
You must be signed in to change notification settings - Fork 118
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: PR930 ArgoCD pipeline set the namespace based on user input #1081
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we change the string to "Enter the destination namespace for the Argo CD pipeline" |
||
[]string{}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of providing empty context |
||
"", | ||
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, | ||
}, | ||
}, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the variable name from
ConfigCICDArgoDestinationNameSpace
toConfigCICDArgoCDDestinationNameSpaceKey
?Also, can you add a new constant
ConfigCICDArgoCDKey = ConfigCICDKey + d + "argocd"
(like we have for Tekton here), and change the value ofConfigCICDArgoCDDestinationNameSpaceKey
toConfigCICDArgoCDKey + d + "destnamespace"