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 a --why to zarf dev find-images to show the chart and resource that generated the image reference #2272

Closed
Racer159 opened this issue Jan 30, 2024 · 0 comments · Fixed by #2309
Labels
enhancement ✨ New feature or request

Comments

@Racer159
Copy link
Contributor

Racer159 commented Jan 30, 2024

Is your feature request related to a problem? Please describe.

As Ezra I want a way to find out how Zarf came to find an image reference so that I can more easily track down where this reference came from in my manifests or helm charts.

Describe the solution you'd like

  • Given I have a zarf.yaml that returns images from zarf dev find-images
  • When I run zarf dev find-images <path-to-zarf-yaml> --why <image-ref>
  • Then Zarf will not return the full image list
  • And will instead return the name of the first chart and resource that that reference was found within.

i.e.

zarf dev find-images examples/dos-games/ --why defenseunicorns/zarf-game:multi-tile-dark

should return:

component: baseline
manifest: multi-games
resource:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: game
spec:
  selector:
    matchLabels:
      app: game
  template:
    metadata:
      labels:
        app: game
    spec:
      containers:
        - name: multi-game
          image: "defenseunicorns/zarf-game:multi-tile-dark"
          ports:
            - name: http
              containerPort: 8000
              protocol: TCP
          resources:
            requests:
              memory: "32Mi"
              cpu: "50m"
            limits:
              memory: "128Mi"
              cpu: "250m"

Describe alternatives you've considered

We could try to dig into the values files ourselves but this would only work for charts and may not be useful in all cases (it also assumes the images are not hardcoded)

Additional context

Zarf should do its best to highlight the image reference in the templated manifest by changing its color or bolding it.

@Racer159 Racer159 added the enhancement ✨ New feature or request label Jan 30, 2024
Noxsios pushed a commit that referenced this issue Mar 6, 2024
## Description

Add a `--why` flag for `zarf dev find-images`

## Related Issue

Fixes #2272

## Type of change

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

## Checklist before merging

- [x] 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: Vibhav Bobade <vibhav.bobde@gmail.com>
Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
Co-authored-by: Lucas Rodriguez <lucas.rodriguez@defenseunicorns.com>
Co-authored-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
Status: Done
Status: Closed
Development

Successfully merging a pull request may close this issue.

1 participant