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: relative paths for bundle create #453

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/pkg/bundle/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ func (b *Bundle) ValidateBundleResources(bundle *types.UDSBundle, spinner *messa

// validate access to packages as well as components referenced in the package
for idx, pkg := range bundle.Packages {
// if package path is set, make it relative to source directory
UncleGedd marked this conversation as resolved.
Show resolved Hide resolved
if pkg.Path != "" {
pkg.Path = fmt.Sprintf("%s/%s", b.cfg.CreateOpts.SourceDirectory, pkg.Path)
decleaver marked this conversation as resolved.
Show resolved Hide resolved
}

spinner.Updatef("Validating Bundle Package: %s", pkg.Name)
if pkg.Name == "" {
return fmt.Errorf("%s is missing required field: name", pkg)
Expand Down
2 changes: 1 addition & 1 deletion src/test/bundles/03-local-and-remote/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ packages:
repository: ghcr.io/defenseunicorns/uds-cli/nginx
ref: 0.0.1
- name: podinfo
path: "src/test/packages/podinfo"
path: "../../packages/podinfo"
ref: 0.0.1
2 changes: 1 addition & 1 deletion src/test/bundles/04-init/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
# cannot do uds remove on this pkg due to having the same name
packages:
- name: init
path: "src/test/packages"
path: "../../packages"
# renovate: datasource=github-tags depName=defenseunicorns/zarf
ref: v0.32.3
optionalComponents:
Expand Down
2 changes: 1 addition & 1 deletion src/test/bundles/05-gitrepo/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ metadata:

packages:
- name: gitrepo
path: "src/test/packages/gitrepo"
path: "../../packages/gitrepo"
ref: 0.0.1
2 changes: 1 addition & 1 deletion src/test/bundles/07-helm-overrides/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:

packages:
- name: helm-overrides
path: "src/test/packages/helm"
path: "../../packages/helm"
ref: 0.0.1

overrides:
Expand Down
4 changes: 2 additions & 2 deletions src/test/bundles/08-var-precedence/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:

packages:
- name: helm-overrides
path: "src/test/packages/helm"
path: "../../packages/helm"
ref: 0.0.1
overrides:
podinfo-component:
Expand All @@ -22,5 +22,5 @@ packages:
default: "uds.dev"

- name: output-var
path: "src/test/packages/no-cluster/output-var"
path: "../../packages/no-cluster/output-var"
ref: 0.0.1
2 changes: 1 addition & 1 deletion src/test/bundles/09-uds-bundle-yml/uds-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ metadata:

packages:
- name: nginx
path: "src/test/packages/nginx"
path: "../../packages/nginx"
ref: 0.0.1
2 changes: 1 addition & 1 deletion src/test/bundles/11-real-simple/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:

packages:
- name: real-simple
path: "src/test/packages/no-cluster/real-simple"
path: "../../packages/no-cluster/real-simple"
ref: 0.0.1
2 changes: 1 addition & 1 deletion src/test/bundles/12-exported-pkg-vars/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages:
- name: BOOL

- name: helm-overrides
path: "src/test/packages/helm"
path: "../../packages/helm"
ref: 0.0.1
imports:
- name: COLOR
Expand Down
Loading