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

Inception: Importing a local component when local component imports a URL #1827

Closed
benmountjoy111 opened this issue Jun 15, 2023 · 0 comments · Fixed by #2058
Closed

Inception: Importing a local component when local component imports a URL #1827

benmountjoy111 opened this issue Jun 15, 2023 · 0 comments · Fixed by #2058

Comments

@benmountjoy111
Copy link
Contributor

benmountjoy111 commented Jun 15, 2023

Environment

Device and OS: MacOS Ventura 13.2.1
App version: zarf v0.27.1
Kubernetes distro being used: N/A
Other:

Steps to reproduce

# create zarf.yaml (to be locally imported)
mkdir bigbang

cat <<EOF> bigbang/zarf.yaml
kind: ZarfPackageConfig
metadata:
  name: dubbd
  description: "Defense Unicorns BigBang Distro"
  architecture: amd64

components:
  - name: load-certs
    required: true
    import:
      name: load-certs
      url: oci://ghcr.io/defenseunicorns/packages/dubbd:0.2.2-skeleton

  - name: preflight
    required: true
    import:
      name: preflight
      url: oci://ghcr.io/defenseunicorns/packages/dubbd:0.2.2-skeleton
EOF

# create top-level zarf.yaml which will import components from the one above
cat <<EOF> zarf.yaml
kind: ZarfPackageConfig
metadata:
  name: parent
  architecture: amd64

components:
  - name: load-certs
    required: true
    import:
      path: './bigbang/'

  - name: preflight
    required: true
    import:
      path: './bigbang/'
EOF

# create parent package
zarf package create
# Observe no contents for load-certs and preflight (first screenshot)

# create sub package
cd bigbang
zarf package create
# Observe populated/correct contents for load-certs and preflight (second screenshot)

Expected result

Doing a 'zarf package create', which includes a locally imported component (which the locally imported component then imports a url) will correctly include the url's component's contents.

Actual Result

Doing a 'zarf package create', which includes a locally imported component (which the locally imported component then imports a url), creates 'empty' components.

Visual Proof (screenshots, videos, text, etc)

Screenshot 2023-06-15 at 2 10 42 PM

Screenshot 2023-06-15 at 2 11 05 PM

Severity/Priority

Additional Context

@Racer159 Racer159 added this to the The Bucket milestone Jun 29, 2023
Racer159 added a commit that referenced this issue Oct 31, 2023
Racer159 added a commit that referenced this issue Oct 31, 2023
Racer159 added a commit that referenced this issue Nov 1, 2023
## Description

```go
chain, err := composer.NewImportChain(pkg.Components[0], "amd64")
if err != nil {
    panic(err)
}

fmt.Println(chain.String())
```

results in:

```
component "k3s" imports "k3s" in packages/distros/k3s, which imports "k3s" in common
```

## Related Issue

Fixes #2037 
Fixes #1827
Fixes #1845

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: razzle <[email protected]>
Co-authored-by: Wayne Starr <[email protected]>
Co-authored-by: Wayne Starr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants