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: Empty resource whitelist allowed all resources (#5540) #5551

Merged
merged 4 commits into from Mar 1, 2021

Conversation

jangraefen
Copy link
Contributor

@jangraefen jangraefen commented Feb 18, 2021

Fixes #5540

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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 included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@jangraefen jangraefen changed the title fix: Empty resource whitelist allows all resources fix: Empty resource whitelist allows all resources (#5540) Feb 18, 2021
@jangraefen jangraefen force-pushed the fix/cluster-resources-whitelist branch from 8d8b1d7 to 9e0b346 Compare February 18, 2021 22:14
@jangraefen jangraefen changed the title fix: Empty resource whitelist allows all resources (#5540) fix: Empty resource whitelist allowed all resources (#5540) Feb 18, 2021
@jangraefen jangraefen force-pushed the fix/cluster-resources-whitelist branch from 9e0b346 to b68f4fe Compare February 19, 2021 17:02
This requires setting the default in quite a few
places around the code base as well as adapting
a couple of tests

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
@jangraefen jangraefen force-pushed the fix/cluster-resources-whitelist branch from b68f4fe to 3e98e04 Compare February 19, 2021 17:07
@jangraefen jangraefen marked this pull request as ready for review February 19, 2021 17:41
@jangraefen
Copy link
Contributor Author

The CodeQL fail seems to be unrelated to my change, so here goes nothing.

@jannfis
Copy link
Member

jannfis commented Feb 22, 2021

Thanks for your PR, @jangraefen. Before reviewing & merging this one, we should make sure that it's the correct intended behavior as discussed in #5540.

The CodeQL fail seems to be unrelated to my change, so here goes nothing.

FWIW, I submitted two PRs (#5563, #5564) to fix the CodeQL complaints.

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
@jangraefen
Copy link
Contributor Author

Sure, let's first see the result of #5540 before we proceed. Still, I fast-forwared the master onto the branch to fix the CodeQL problem. Thanks for the hint @jannfis 🙂.

@jangraefen jangraefen force-pushed the fix/cluster-resources-whitelist branch from 2f7f994 to 7fe0217 Compare February 25, 2021 19:58
Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
@jangraefen jangraefen force-pushed the fix/cluster-resources-whitelist branch from 7fe0217 to eadcfe5 Compare February 27, 2021 15:11
@codecov-io
Copy link

codecov-io commented Feb 27, 2021

Codecov Report

Merging #5551 (7fe0217) into master (24b18a8) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5551      +/-   ##
==========================================
+ Coverage   40.90%   40.92%   +0.02%     
==========================================
  Files         144      144              
  Lines       19214    19214              
==========================================
+ Hits         7860     7864       +4     
+ Misses      10258    10255       -3     
+ Partials     1096     1095       -1     
Impacted Files Coverage Δ
pkg/apis/application/v1alpha1/types.go 56.49% <100.00%> (+0.19%) ⬆️
cmd/argocd/commands/login.go 2.42% <0.00%> (ø)
server/application/application.go 28.87% <0.00%> (+0.06%) ⬆️
server/application/logs.go 88.23% <0.00%> (+2.52%) ⬆️

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 24b18a8...dd4a1e3. Read the comment docs.

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
@jangraefen
Copy link
Contributor Author

@jannfis I adapted to code to match the result of the discussion in #5540. Feel free to have a look again 🙂

Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for this fix, @jangraefen!

@jannfis jannfis added the cherry-pick/1.8 Candidate for cherry picking into the 1.8 release branch label Mar 1, 2021
@jannfis
Copy link
Member

jannfis commented Mar 1, 2021

@alexmt Shall we cherry-pick this into 1.8 (and possibly 1.7) as well?

@jannfis jannfis merged commit cbc04c7 into argoproj:master Mar 1, 2021
@alexmt
Copy link
Collaborator

alexmt commented Mar 1, 2021

agree, cherry-picking

alexmt pushed a commit that referenced this pull request Mar 1, 2021
* fix: Empty resource whitelist allowed all resources

This requires setting the default in quite a few
places around the code base as well as adapting
a couple of tests

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>

* Improve default behavior and not require explicitly set whitelist

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
alexmt pushed a commit that referenced this pull request Mar 1, 2021
* fix: Empty resource whitelist allowed all resources

This requires setting the default in quite a few
places around the code base as well as adapting
a couple of tests

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>

* Improve default behavior and not require explicitly set whitelist

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
shubhamagarwal19 pushed a commit to shubhamagarwal19/argo-cd that referenced this pull request Apr 15, 2021
…rgoproj#5551)

* fix: Empty resource whitelist allowed all resources

This requires setting the default in quite a few
places around the code base as well as adapting
a couple of tests

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>

* Improve default behavior and not require explicitly set whitelist

Signed-off-by: Jan Graefen <223234+jangraefen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/1.8 Candidate for cherry picking into the 1.8 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppProjects allow cluster resources to be applied by default and when clusterResourceWhitelist is "[]"
4 participants