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

ensure multi source spec is handled #124

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

nabuskey
Copy link
Collaborator

@nabuskey nabuskey commented Dec 26, 2023

Fixes an issue when you are using multi sources in ArgoCD, the repo url was not updated correctly. It was because we were not updating the correct object.

Signed-off-by: Manabu McCloskey <[email protected]>
Comment on lines 11 to 13
- repoURL: cnoe://busybox
targetRevision: HEAD
path: "."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I missed something but this test case only includes one source and not (as title mentions) several sources !

Copy link
Collaborator Author

@nabuskey nabuskey Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's meant to represent a case when the sources field is used. Which is not exactly the same as what is described in the title. I'll update the test.

@nabuskey
Copy link
Collaborator Author

nabuskey commented Jan 2, 2024

Updated it to further handle a case where the same directory is specified twice in the spec. This is a valid configuration since you can specify the path parameter to distinguish the two.

spec:
  sources:
    - repoURL: cnoe://app2
      targetRevision: HEAD
      path: "one"
    - repoURL: cnoe://app2
      targetRevision: HEAD
      path: "two"

Copy link
Contributor

@jessesanford jessesanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -190,8 +190,13 @@ func (r *Reconciler) reconcileGitRepo(ctx context.Context, resource *v1alpha1.Cu
}
return nil
})
// it's possible for an application to specify the same directory multiple times in the spec.
// if there is a repository already created for this package, no further action is necessary.
if !errors.IsAlreadyExists(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@nabuskey nabuskey merged commit 0d25f39 into cnoe-io:main Jan 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants