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

fix: raise error if app dest namespace not managed by argocd (#4329) #4352

Closed

Conversation

jopit
Copy link
Contributor

@jopit jopit commented Sep 16, 2020

Signed-off-by: John Pitman jpitman@redhat.com

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 USERS.md.
  • I've signed the CLA and my build is green (troubleshooting builds).

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2020

Codecov Report

Merging #4352 into master will increase coverage by 0.01%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4352      +/-   ##
==========================================
+ Coverage   42.81%   42.82%   +0.01%     
==========================================
  Files         124      124              
  Lines       18430    18444      +14     
==========================================
+ Hits         7890     7899       +9     
- Misses       9523     9527       +4     
- Partials     1017     1018       +1     
Impacted Files Coverage Δ
util/argo/argo.go 74.27% <81.81%> (+0.31%) ⬆️
server/application/application.go 30.25% <0.00%> (-0.10%) ⬇️

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 d4ddd51...125f5b0. Read the comment docs.

Signed-off-by: John Pitman <jpitman@redhat.com>
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.

Thanks for working on it @jopit !

Couple edge cases are not taken into account in this PR:

The target application namespace is used as the default namespace. If resource namespace is explicitly specified in manifest stored in git then the resource will be created in that namespace.

Starting 1.7 the namespace field is optional. All application resources might have "hard-coded" namespace or application might include only cluster level resource.

I think the namespace check should be performed in GetManagedLiveObjs method:

https://github.com/argoproj/gitops-engine/blob/c04f859da9b2038b3ad1913be6589858d6311a0a/pkg/cache/cluster.go#L667

We need to validate namespace for each item of targetObjs []*unstructured.Unstructured parameter.

@jopit
Copy link
Contributor Author

jopit commented Sep 17, 2020

As this is the wrong fix, I will close this PR.

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