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

feat: Support cluster name on Application destination. Closes #1548 #2808

Merged
merged 15 commits into from
Jun 20, 2020
Merged

feat: Support cluster name on Application destination. Closes #1548 #2808

merged 15 commits into from
Jun 20, 2020

Conversation

lcostea
Copy link
Member

@lcostea lcostea commented Dec 4, 2019

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Optional. My organization is added to the README.
  • I've signed the CLA and my build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Dec 4, 2019

Codecov Report

Merging #2808 into master will increase coverage by 0.12%.
The diff coverage is 52.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2808      +/-   ##
==========================================
+ Coverage   41.70%   41.83%   +0.12%     
==========================================
  Files         116      116              
  Lines       16744    16726      -18     
==========================================
+ Hits         6983     6997      +14     
+ Misses       8855     8828      -27     
+ Partials      906      901       -5     
Impacted Files Coverage Δ
pkg/apis/application/v1alpha1/types.go 60.97% <0.00%> (-0.91%) ⬇️
server/application/application.go 28.31% <0.00%> (-0.31%) ⬇️
cmd/argocd/commands/app.go 5.62% <33.33%> (+0.05%) ⬆️
controller/appcontroller.go 43.78% <57.14%> (+0.11%) ⬆️
util/argo/argo.go 74.40% <87.87%> (+1.60%) ⬆️
server/rbacpolicy/rbacpolicy.go 82.43% <0.00%> (+3.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9633417...cb9c834. Read the comment docs.

@lcostea
Copy link
Member Author

lcostea commented Dec 6, 2019

@alexec When you have some time, please take a look at this.
I tried to follow the ideas discussed on #2381 to switch asap to use the Server field, so this way there will be very few changes to the code.

I still need to check/update the UI, but for that I will open another PR if needed

@alexec alexec self-assigned this Dec 6, 2019
@alexec alexec self-requested a review December 6, 2019 22:43
@lcostea lcostea changed the title Support cluster name on Application destination. Closes #1548 feat: Support cluster name on Application destination. Closes #1548 Dec 19, 2019
@lcostea
Copy link
Member Author

lcostea commented Dec 19, 2019

Any chance to get some feedback now before the holidays, so I will have time to address it?

@alexmt
Copy link
Collaborator

alexmt commented Dec 19, 2019

Sorry for the delay with review @lcostea . We've got distracted by v1.3 performance challenges. Definitely looking at the PR today evening or first thing tomorrow morning

@alexmt alexmt assigned alexmt and unassigned alexec Dec 20, 2019
util/argo/argo.go Show resolved Hide resolved
util/argo/argo.go Show resolved Hide resolved
util/argo/argo.go Outdated Show resolved Hide resolved
@@ -916,6 +916,10 @@ func (ctrl *ApplicationController) refreshAppConditions(app *appv1.Application)
})
}
} else {
destCondition := argo.ValidateDestination(context.Background(), &app.Spec.Destination, ctrl.db)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to infer server field in processAppOperationQueueItem method too. E.g. finalizeApplicationDeletion uses Destination.Server field.

vadasambar pushed a commit to infracloudio/dev-env that referenced this pull request Jan 10, 2020
details
-----------
- dev env controller to provision a gke cluster through crossplane and install an argocd application
- uses kubebuilder
- based off an experimental PR in argocd: argoproj/argo-cd#2808
- provisions nodepools through controller now. This should be handled by crossplane in the future
@vadasambar
Copy link

Any updates on this?
I think this will open up the doors for really interesting things. I am eagerly looking forward to this PR getting merged.

@lcostea
Copy link
Member Author

lcostea commented Jan 13, 2020

I had a little longer vacation, but I am back on this and hoping to get it done in the following days.

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

@vadasambar
Copy link

Hey @lcostea, any updates on this PR?

@shaikatz
Copy link

Eager to see that merged.

@lcostea
Copy link
Member Author

lcostea commented Apr 23, 2020

Working now to have this rebased, to fix the failing tests and increase code coverage
Hope to be ready for a review in 1-2 weeks

@micke
Copy link
Contributor

micke commented Apr 23, 2020

@lcostea really appreciate the work you are doing!

@vadasambar
Copy link

Thank you @lcostea !

@lcostea
Copy link
Member Author

lcostea commented May 4, 2020

Now that I reached a good test coverage, the next couple of days I will concentrate on doing many manual tests with 1-2 external clusters addressed by name in the apps

@alexmt
Copy link
Collaborator

alexmt commented Jun 3, 2020

Thank you for resolving merge conflicts!

@cyrus-mc
Copy link

+1 for this feature.

Would make it easier on Developers who usually only know the cluster by name, not server address.

@alexmt
Copy link
Collaborator

alexmt commented Jun 19, 2020

@lcostea , thanks a lot for PR and patience!

My only concern is the isServerInferred field in CRD and Argo CD API . This is internal field and should not be visible. I found that is can be removed if field annotation is changed to json:"-" . I've implemented changes trying to find solution and send PR to your branch: https://github.com/lcostea/argo-cd/pull/1/files

Let me know if it looks good, please.

@lcostea
Copy link
Member Author

lcostea commented Jun 20, 2020

@alexmt I integrated your changes, but I can't get it to work with the

isServerInferred bool `json:"-"`

I tried a couple of options, but either fails on lint or on crd generation

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexmt alexmt merged commit 7ccb16b into argoproj:master Jun 20, 2020
@micke
Copy link
Contributor

micke commented Jun 20, 2020

Great work guys! This is going to make declarative setup so much better!

In which release will this change be included? Next major or sooner?

@mgoodness
Copy link
Contributor

This is a fantastic improvement in useability. Thanks, @lcostea!

@lcostea
Copy link
Member Author

lcostea commented Jun 21, 2020

thanks @alexmt for your support.
Next I am going to look at the UI, it could use some improvements when using cluster name,

@lcostea lcostea deleted the liviu/add_destination_name_alias branch June 21, 2020 09:28
@cyrus-mc
Copy link

cyrus-mc commented Jul 8, 2020

@lcostea I have been running a build with this change in a non-prod environment.

From time to time an error is shown on the application page with the message "NotFound desc = cluster "" not found".

This sometimes results in sync or delete of application to hang with the following message in the application-controller logs

level=info msg="Unable to delete application resources: rpc error: code = NotFound desc = cluster \"\" not found" application=argocd-helloworld-test dest-namespace=test dest-server= reason=StatusRefreshed type=Warning

@lcostea
Copy link
Member Author

lcostea commented Jul 9, 2020

@cyrus-mc thanks for letting me know, I am checking this. The sync and delete, are you doing them from the UI?

@cyrus-mc
Copy link

@cyrus-mc thanks for letting me know, I am checking this. The sync and delete, are you doing them from the UI?

Yes. It is odd because it doesn't always happen. But I do see the error pretty much all the time. Just that sync or delete aren't impacted.

I am using EKS with IAM authentication.

@lcostea
Copy link
Member Author

lcostea commented Jul 15, 2020

@cyrus-mc I managed to reproduce it. I just opened a PR for changes in the UI part to support destination name (#3944) and next I am checking this issue.

@alexmt
Copy link
Collaborator

alexmt commented Aug 3, 2020

@lcostea , @cyrus-mc FYI. I've also reproduced cluster \"\" not found" error. Apparently we've forgotten to add argo.ValidateDestination in two places. Prepared PR with the fix: #4039

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.

10 participants