carvel-dev / carvel-dev/kapp-controller

Add --keep-temp-files flag to kctrl dev

Open
#1,050 6 comments 0 reactions 0 assignees View on GitHub
carvel-accepted cli enhancement priority/unprioritized-backlog
Dominant language
Go
Stars
323
Forks
127
Avg merge
2d 10h
Merged PRs (30d)
6

Description

**Describe the problem/challenge you have**

Trying to debug the behavior of kappcontroller with `kctrl dev`, the files passed to ytt are temporary and deleted upon completion of the command. As a result, it pretty hard to inspect them and interactively rerun the corresponding ytt command

**Describe the solution you'd like**

A new `--keep-temp-files` flag to kctrl dev to prevent deleting the temporary directory

**Anything else you would like to add:**

```
$ kctrl dev -l -f postgresql-composition-app.yaml
[...]
econciling in-memory app/postgresql-composition-ytt-app (namespace: 75-crossplane-resources-ytt) ...
==> Executing /usr/local/bin/vendir [vendir sync -f - --lock-file /dev/null]
==> Finished executing /usr/local/bin/vendir ==> Executing /usr/local/bin/ytt [ytt -f /tmp/kapp-controller-fetch-template-deploy2547740875/0/config --data-values-file /tmp/kapp-controller-template-values437011557/external_gcp_poc_openshift_cluster_vpc_netw
ork --data-values-file /tmp/kapp-controller-template-values437011557/external_gcp_poc_route_domain --data-values-file /tmp/kapp-controller-template-values437011557/external_gcp_project_id --data-values-file /tmp
/kapp-controller-template-values437011557/external_gcp_region --data-values-file /tmp/kapp-controller-fetch-template-deploy2547740875/0/values/values.yaml]
==> Finished executing /usr/local/bin/ytt


12:39:59PM: Fetch started (1s ago)
12:40:00PM: Fetching
| apiVersion: vendir.k14s.io/v1alpha1
| directories:
| - contents:
| - git:
| commitTitle: 'remove manual pvc creation #2...'
| sha: d1b65f266e5078c91ae453c0a72f191835eeff8e
| path: .
| path: "0"
| kind: LockConfig
|
12:40:00PM: Fetch succeeded
12:40:00PM: Template failed
| ytt: Error: Overlaying data values (in following order: additional data values):
| Document on line values.yaml:1:
| Expected map, but was string
|
| Templating dir: Error (see .status.usefulErrorMessage for details)

App tailing error: Reconciling app: Template failed

Succeeded

$ ls -al /tmp/kapp-controller-fetch-template-deploy2547740875/
ls: cannot access '/tmp/kapp-controller-fetch-template-deploy2547740875/': No such file or directory
```

See related slack thread https://kubernetes.slack.com/archives/CH8KCCKA5/p1673453880059389

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.