Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Add support for subPath for source #65

Merged
rashedkvm merged 4 commits into
vmware-tanzu:mainfrom
shashwathi:iss-35
Apr 8, 2022
Merged

Add support for subPath for source #65
rashedkvm merged 4 commits into
vmware-tanzu:mainfrom
shashwathi:iss-35

Conversation

@shashwathi
Copy link
Copy Markdown
Contributor

@shashwathi shashwathi commented Apr 7, 2022

What this PR does / why we need it

This PR adds support for subPath field for sources

Which issue(s) this PR fixes

Fixes #35

Comment thread docs/command-reference/tanzu_apps_workload_apply.md Outdated
Comment thread pkg/commands/workload.go Outdated
Comment on lines +160 to +162
if opts.SubPath != "" && len(source) != 1 {
errs = errs.Also(validation.ErrDisallowedFields(flags.SubPathFlagName, "subPath flag cannot be used without local-path/git-* sources"))
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check needs to be lazy. It should be valid to specify --subpath for an update when there is already source defined, or for a create with a file where the workload already has source defined.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

Comment thread pkg/commands/workload.go Outdated
Comment thread pkg/commands/workload.go Outdated
Comment thread pkg/flags/flags.go Outdated
Comment thread pkg/commands/workload.go Outdated
Comment thread pkg/commands/workload.go Outdated
@shashwathi shashwathi marked this pull request as ready for review April 7, 2022 21:45
@shashwathi shashwathi changed the title Add support for subPath in git/local-path source cases Add support for subPath for source Apr 7, 2022
- update subPath when it is empty. this will allow users to unset the field
Comment thread pkg/commands/workload.go Outdated
Copy link
Copy Markdown
Contributor

@warango4 warango4 left a comment

Choose a reason for hiding this comment

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

LGTM

- Update subPath only when its changed.
@shashwathi
Copy link
Copy Markdown
Contributor Author

@rashedkvm @scothis : Ready for another review

Copy link
Copy Markdown
Member

@rashedkvm rashedkvm left a comment

Choose a reason for hiding this comment

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

Looks good.

@rashedkvm rashedkvm merged commit 8a6d745 into vmware-tanzu:main Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--sub-path parameter supported for --local-path and --git-*

6 participants