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

Add resource namespaces saved during deploy to fallbackAllowedNamespaces #533

Merged
merged 6 commits into from
Sep 19, 2022

Conversation

praveenrewar
Copy link
Member

@praveenrewar praveenrewar commented Jun 19, 2022

What this PR does / why we need it:

Add resource namespaces saved during deploy to fallbackAllowedNamespaces.
These resource namespaces are stored as app change meta during deploy

Which issue(s) this PR fixes:

Fixes #479

Does this PR introduce a user-facing change?

NONE

Additional Notes for your reviewer:

I am still thinking if there's a better place to make this change. Another option that I thought of was to call the FactoryClients separately and a little late (after Exists function is called) and populate the fallbackAllowedNamespaces with the resource namespaces there itself, but that would require a lot of repetition as App.Find requires a lot of things from FactoryClients.

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


@praveenrewar praveenrewar marked this pull request as draft June 19, 2022 06:07
@praveenrewar praveenrewar force-pushed the fallback-namespaces branch from 5a2974d to 8a695f1 Compare June 23, 2022 08:59
@rohitagg2020
Copy link
Contributor

How are we updating the LastChange.Namespaces. Do we update it after every redeploy? If yes, then it will be interesting to see how things will behave when we use filter

@praveenrewar praveenrewar force-pushed the fallback-namespaces branch 4 times, most recently from a95f7e2 to 3bc581e Compare July 11, 2022 16:41
@praveenrewar praveenrewar marked this pull request as ready for review July 12, 2022 05:15
It uses a ServiceAccount with limited scope (no permission to list namespaces)
These resource namespaces are stored in app change meta during deploy
Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

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

Initial thoughts

I will take a closer look at how this affects how we list resources in allowedNamespaces today

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

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

Some more thoughts
Do you wanna pair on this one for a bit, it might help to go over this section I believe

@praveenrewar praveenrewar force-pushed the fallback-namespaces branch 3 times, most recently from 9c93dfb to 1baaaab Compare September 15, 2022 09:34
@100mik
Copy link
Contributor

100mik commented Sep 15, 2022

Code looks good to me, gonna take a closer look at the new test!

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

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

@praveenrewar praveenrewar merged commit 308ce26 into develop Sep 19, 2022
@praveenrewar praveenrewar deleted the fallback-namespaces branch September 21, 2022 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kapp should add namespaces used by resources to fallback namespaces
4 participants