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 fs.FS support to deploy, inspect, diff #799

Merged
merged 4 commits into from
Aug 24, 2023
Merged

Conversation

ncdc
Copy link
Contributor

@ncdc ncdc commented Aug 14, 2023

What this PR does / why we need it:

Allow deploy, inspect, and diff to use an fs.FS for the filesystem so they can be invoked programmatically with filesystems other than just the normal OS one.

Which issue(s) this PR fixes:

Fixes #800

Does this PR introduce a user-facing change?

NONE

Additional Notes for your reviewer:

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.:


Use struct fields as flag defaults. If the flag structs are being filled
in programmatically, the values are cleared during flag parsing if the
flag defaults differ from the current struct values, which is
undesirable.

Signed-off-by: Andy Goldstein <[email protected]>
Add fs.FS support to LocalFileSource, FileResource, and the commands
that use them (deploy, diff, inspect). This is useful so these commands
can be invoked programmatically.

Signed-off-by: Andy Goldstein <[email protected]>
@100mik
Copy link
Contributor

100mik commented Aug 16, 2023

I am going to take a closer look at this in my daytime tomorrow.

I was wondering if you could create an issue illustrating how this change helps and elaborating on your use case? That context would definitely be helpful!

@ncdc
Copy link
Contributor Author

ncdc commented Aug 16, 2023

I created #800 for this, thanks!

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

Thank you so much for the PR @ncdc ❤️
Overall it's looking really good (just left some minor comments).

pkg/kapp/resources/file_resources.go Show resolved Hide resolved
pkg/kapp/resources/file_resources.go Outdated Show resolved Hide resolved
test/e2e/deploy_filesystem_test.go Show resolved Hide resolved
test/e2e/deploy_filesystem_test.go Outdated Show resolved Hide resolved
test/e2e/deploy_filesystem_test.go Outdated Show resolved Hide resolved
Signed-off-by: Andy Goldstein <[email protected]>
Signed-off-by: Andy Goldstein <[email protected]>
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

LGTM.
@100mik Let me know if you are planning to take a look at it.

@praveenrewar praveenrewar merged commit 8c1610f into carvel-dev:develop Aug 24, 2023
5 checks passed
@100mik
Copy link
Contributor

100mik commented Aug 24, 2023

Thanks for the PR again!

@github-actions github-actions bot added the carvel triage This issue has not yet been reviewed for validity label Aug 24, 2023
@praveenrewar praveenrewar removed the carvel triage This issue has not yet been reviewed for validity label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Allow kapp deploy go code to be used with an fs.FS
3 participants