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

lib: configure pterm output during Deploy lifecycle #2372

Closed
UncleGedd opened this issue Mar 11, 2024 · 0 comments · Fixed by #2380
Closed

lib: configure pterm output during Deploy lifecycle #2372

UncleGedd opened this issue Mar 11, 2024 · 0 comments · Fixed by #2380
Labels
enhancement ✨ New feature or request uds

Comments

@UncleGedd
Copy link
Contributor

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

In this branch of UDS CLI, we are bringing in BubbleTea as our TUI. For most Zarf packages, we can configure Zarf with message.NoProgress = true and everything looks great

Screenshot 2024-03-11 at 9 30 24 AM

However, when deploying a package after an init pkg we get pterm artifacts showing up in our BubbleTea program

kind: UDSBundle
metadata:
  name: test
  version: 0.0.1

packages:
  - name: init
    repository: ghcr.io/defenseunicorns/packages/init
    ref: v0.32.4
    optionalComponents:
      - git-server
  - name: podinfo
    path: "../../packages/podinfo"
    ref: 0.0.1

Screenshot 2024-03-11 at 9 35 07 AM

Describe the solution you'd like

We'd like to:

  • continue to capture Zarf logs in the log file
  • not show any pterm output during the BubbleTea program

Additional Details

Haven't looked too much into it, but it looks like there are instances in the Zarf deploy lifecycle that modify pterm's output: example

@UncleGedd UncleGedd added the enhancement ✨ New feature or request label Mar 11, 2024
@UncleGedd UncleGedd changed the title Lib: configure pterm output during Deploy lifecyle Lib: configure pterm output during Deploy lifecycle Mar 11, 2024
@Noxsios Noxsios added the uds label Mar 12, 2024
@Noxsios Noxsios changed the title Lib: configure pterm output during Deploy lifecycle lib: configure pterm output during Deploy lifecycle Mar 12, 2024
@Noxsios Noxsios linked a pull request Mar 14, 2024 that will close this issue
5 tasks
Noxsios added a commit that referenced this issue Mar 18, 2024
## Description

Allows for Zarf's logs to still be sent to a log file, but be muted
otherwise.

```go
logFile, err := message.UseLogFile("")
if err != nil {
	return err // handle the error as you see fit
}

location := message.LogFileLocation() // get the log file location if you want to

// set pterm output to only go to this logfile
pterm.SetDefaultOutput(logFile)

// disable progress bars (otherwise they will still get printed to STDERR)
message.NoProgress = true
```

## Related Issue

Fixes #2372 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] 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 <harry@razzle.cloud>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request uds
Projects
Status: Done
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants