Skip to content

Commit 6861c32

Browse files
[v1.18] [GITOPS-7844]: GitOpsService controller creates default ArgoCD with v1alpha1 api version (#985)
* GitOpsService controller creates default ArgoCD with v1alpha1 api version Signed-off-by: akhil nittala <[email protected]> * GitOpsService controller creates default ArgoCD with v1alpha1 api version Signed-off-by: akhil nittala <[email protected]> --------- Signed-off-by: akhil nittala <[email protected]> Co-authored-by: akhil nittala <[email protected]>
1 parent 66b8a8b commit 6861c32

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

controllers/argocd/argocd.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,7 @@ func NewCR(name, ns string) (*argoapp.ArgoCD, error) {
231231
if err != nil {
232232
return nil, err
233233
}
234-
235234
return &argoapp.ArgoCD{
236-
TypeMeta: metav1.TypeMeta{
237-
Kind: "ArgoCD",
238-
APIVersion: "argoproj.io/v1alpha1",
239-
},
240235
ObjectMeta: metav1.ObjectMeta{
241236
Name: name,
242237
Namespace: ns,

controllers/gitopsservice_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (r *ReconcileGitopsService) Reconcile(ctx context.Context, request reconcil
261261
} else {
262262
// If installation of default Argo CD instance is disabled, make sure it doesn't exist,
263263
// deleting it if necessary
264-
if err := r.ensureDefaultArgoCDInstanceDoesntExist(instance, reqLogger); err != nil {
264+
if err := r.ensureDefaultArgoCDInstanceDoesntExist(); err != nil {
265265
return reconcile.Result{}, fmt.Errorf("unable to ensure non-existence of default Argo CD instance: %v", err)
266266
}
267267
}
@@ -306,7 +306,7 @@ func (r *ReconcileGitopsService) Reconcile(ctx context.Context, request reconcil
306306
}
307307
}
308308

309-
func (r *ReconcileGitopsService) ensureDefaultArgoCDInstanceDoesntExist(instance *pipelinesv1alpha1.GitopsService, reqLogger logr.Logger) error {
309+
func (r *ReconcileGitopsService) ensureDefaultArgoCDInstanceDoesntExist() error {
310310

311311
defaultArgoCDInstance, err := argocd.NewCR(common.ArgoCDInstanceName, serviceNamespace)
312312
if err != nil {

0 commit comments

Comments
 (0)