status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
βŒ€
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/item.go
m, cmd := g.groupModel.Update(msg) g.groupModel = m.(groupModel) return g, cmd } func (g *Group) ScrollPercent() float64 { return g.groupModel.ScrollPercent() } func (g *Group) sort() { sort.SliceStable(g.entries, func(i, j int) bool { ie := g.entries[i] je := g.entries[j] switch { case ie.Started() == nil && je.Started() == nil: return false case ie.Started() == nil && je.Started() != nil: return false case ie.Started() != nil && je.Started() == nil: return true case ie.Started() != nil && je.Started() != nil: return ie.Started().Before(*je.Started()) default: return false } }) } type emptyGroup struct {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/item.go
height int } func (g *emptyGroup) SetHeight(height int) { g.height = height } func (g *emptyGroup) SetWidth(int) {} func (g *emptyGroup) ScrollPercent() float64 { return 1 } func (*emptyGroup) Init() tea.Cmd { return nil } func (g *emptyGroup) Update(tea.Msg) (tea.Model, tea.Cmd) { return g, nil } func (g emptyGroup) View() string { return strings.Repeat("\n", g.height-1) } func (g emptyGroup) Save(dir string) (string, error) { return "", nil }
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
package tui import ( "fmt" "strings" "time" "github.com/charmbracelet/bubbles/spinner" "github.com/charmbracelet/bubbles/viewport" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" ) type TreeEntry interface { tea.Model ID() string Inputs() []string Name() string Entries() []TreeEntry Infinite() bool Started() *time.Time Completed() *time.Time Cached() bool Error() *string SetWidth(int) SetHeight(int) ScrollPercent() float64 Save(dir string) (string, error) Open() tea.Cmd } type Tree struct {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
viewport viewport.Model root TreeEntry currentOffset int focus bool spinner spinner.Model collapsed map[TreeEntry]bool } func (m *Tree) Init() tea.Cmd { return m.spinner.Tick } func (m *Tree) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd m.spinner, cmd = m.spinner.Update(msg) return m, cmd } func (m *Tree) SetRoot(root TreeEntry) { m.root = root } func (m *Tree) SetWidth(width int) { m.viewport.Width = width } func (m *Tree) SetHeight(height int) { m.viewport.Height = height } func (m *Tree) UsedHeight() int { if m.root == nil { return 0 } return m.height(m.root) }
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
func (m Tree) Root() TreeEntry { return m.root } func (m Tree) Current() TreeEntry { return m.nth(m.root, m.currentOffset) } func (m *Tree) Focus(focus bool) { m.focus = focus } func (m *Tree) Open() tea.Cmd { return m.Current().Open() } func (m *Tree) View() string { if m.root == nil { return "" } offset := m.currentOffset views := m.itemView(0, m.root, []bool{}) m.viewport.SetContent(strings.Join(views, "\n")) if offset >= m.viewport.YOffset+m.viewport.Height { m.viewport.SetYOffset(offset - m.viewport.Height + 1) } if offset < m.viewport.YOffset { m.viewport.SetYOffset(offset) } return m.viewport.View() } func (m *Tree) treePrefixView(padding []bool) string { pad := strings.Builder{} for i, last := range padding {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
leaf := i == len(padding)-1 switch { case leaf && !last: pad.WriteString(" β”œβ”€") case leaf && last: pad.WriteString(" └─") case !leaf && !last: pad.WriteString(" β”‚ ") case !leaf && last: pad.WriteString(" ") } } return pad.String() } func (m *Tree) statusView(item TreeEntry) string { if item.Cached() { return cachedStatus.String() } if item.Error() != nil { return failedStatus.String() } if item.Started() != nil { if item.Completed() != nil { return completedStatus.String() } return m.spinner.View() } return " " } func (m *Tree) timerView(item TreeEntry) string {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
if item.Started() == nil { return "" } if item.Cached() { return itemTimerStyle.Render("CACHED ") } done := item.Completed() if done == nil { now := time.Now() done = &now } diff := done.Sub(*item.Started()) prec := 1 sec := diff.Seconds() if sec < 10 { prec = 2 } else if sec < 100 { prec = 1 } return itemTimerStyle.Render(fmt.Sprintf("%.[2]*[1]fs ", sec, prec)) } func (m *Tree) height(item TreeEntry) int { height := 1 entries := item.Entries() if entries == nil || m.collapsed[item] { return height } for _, e := range entries { height += m.height(e) }
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
return height } func (m *Tree) itemView(offset int, item TreeEntry, padding []bool) []string { renderedItems := []string{} status := " " + m.statusView(item) + " " treePrefix := m.treePrefixView(padding) expandView := "" if item.Entries() != nil { if collapsed := m.collapsed[item]; collapsed { expandView = "β–Ά " } else { expandView = "β–Ό " } } timerView := m.timerView(item) itemWidth := m.viewport.Width - lipgloss.Width(status) - lipgloss.Width(treePrefix) - lipgloss.Width(timerView) nameWidth := itemWidth - lipgloss.Width(expandView) - 2 // space on each side name := trunc(item.Name(), nameWidth) itemView := lipgloss.NewStyle(). Inline(true). Width(max(0, itemWidth)). Render(" " + expandView + name + " ") view := status + treePrefix if item == m.Current() { if m.focus && offset == m.currentOffset {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
view += selectedStyle.Render(itemView + timerView) } else { view += selectedStyleBlur.Render(itemView + timerView) } } else { view += itemView + timerView } renderedItems = append(renderedItems, view) offset++ entries := item.Entries() if entries == nil || m.collapsed[item] { return renderedItems } for i, s := range entries { pad := append([]bool{}, padding...) if i == len(entries)-1 { pad = append(pad, true) } else { pad = append(pad, false) } views := m.itemView(offset, s, pad) offset += len(views) renderedItems = append(renderedItems, views...) } return renderedItems } func (m *Tree) MoveUp() { if m.currentOffset == 0 { return }
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
m.currentOffset-- } func (m *Tree) MoveToTop() { m.currentOffset = 0 } func (m *Tree) MoveDown() { if m.currentOffset == m.height(m.root)-1 { return } m.currentOffset++ } func (m *Tree) MoveToBottom() { m.currentOffset = m.height(m.root) - 1 } func (m *Tree) PageUp() { for i := 0; i < m.viewport.Height; i++ { m.MoveUp() } } func (m *Tree) PageDown() { for i := 0; i < m.viewport.Height; i++ { m.MoveDown() } } func (m *Tree) Collapse(entry TreeEntry, recursive bool) { m.setCollapsed(entry, true, recursive) } func (m *Tree) Expand(entry TreeEntry, recursive bool) { m.setCollapsed(entry, false, recursive) }
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
func (m *Tree) setCollapsed(entry TreeEntry, collapsed, recursive bool) { // Non collapsible if entry == nil || entry.Entries() == nil { return } m.collapsed[entry] = collapsed if !recursive { return } for _, e := range entry.Entries() { m.setCollapsed(e, collapsed, recursive) } } func (m *Tree) Follow() { if m.root == nil { return } current := m.Current() if current == nil { return } if current.Completed() == nil && len(current.Entries()) == 0 { return } oldest := findOldestIncompleteEntry(m.root) if oldest != -1 { m.currentOffset = oldest } } func findOldestIncompleteEntry(entry TreeEntry) int {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
var oldestIncompleteEntry TreeEntry oldestStartedTime := time.Time{} var search func(e TreeEntry) search = func(e TreeEntry) { started := e.Started() completed := e.Completed() cached := e.Cached() entries := e.Entries() if e.Infinite() { // avoid following services, since they run forever return } if len(entries) == 0 && started != nil && completed == nil && !cached { if oldestIncompleteEntry == nil || started.Before(oldestStartedTime) { oldestStartedTime = *started oldestIncompleteEntry = e } } for _, child := range entries { search(child) } } search(entry) return indexOf(entry, oldestIncompleteEntry) } func indexOf(entry TreeEntry, needle TreeEntry) int {
closed
dagger/dagger
https://github.com/dagger/dagger
5,191
🐞 TUI display incorrect when sdk crash with exception
### What is the issue? From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier. ### Log output Auto provisioning mode: ``` file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144 throw new GraphQLRequestError("Error message", { ^ GraphQLRequestError: Error message at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23 at Generator.throw (<anonymous>) at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":.... ``` TUI: <img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0"> ### Steps to reproduce Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`. ### SDK version nodjs sdk 0.5.3 ### OS version macOS 13.1 (22C65)
https://github.com/dagger/dagger/issues/5191
https://github.com/dagger/dagger/pull/5232
b267d5999a927ba73e7978f0938fc827eb642c9c
6d75e9b34a4bf70f454e201849998f34713352db
2023-05-25T03:17:54Z
go
2023-06-01T18:17:32Z
internal/tui/tree.go
if entry == needle { return 0 } for i, child := range entry.Entries() { if found := indexOf(child, needle); found >= 0 { return i + 1 + found } } return -1 } func (m *Tree) nth(entry TreeEntry, n int) TreeEntry { if n == 0 { return entry } if m.collapsed[entry] { return nil } skipped := 1 for _, child := range entry.Entries() { if found := m.nth(child, n-skipped); found != nil { return found } skipped += m.height(child) } return nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
package core import ( "context" "fmt" "path/filepath" "strings" "github.com/dagger/dagger/core/pipeline" bkclient "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" bkgw "github.com/moby/buildkit/frontend/gateway/client" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/vito/progrock" ) type Host struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
Workdir string DisableRW bool } func NewHost(workdir string, disableRW bool) *Host { return &Host{ Workdir: workdir, DisableRW: disableRW, } } type HostVariable struct { Name string `json:"name"` } type CopyFilter struct { Exclude []string Include []string } func (host *Host) Directory(ctx context.Context, dirPath string, p pipeline.Path, platform specs.Platform, filter CopyFilter) (*Directory, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
if host.DisableRW { return nil, ErrHostRWDisabled } var absPath string var err error if filepath.IsAbs(dirPath) { absPath = dirPath } else { absPath = filepath.Join(host.Workdir, dirPath) if !strings.HasPrefix(absPath, host.Workdir) { return nil, fmt.Errorf("path %q escapes workdir; use an absolute path instead", dirPath) } } absPath, err = filepath.EvalSymlinks(absPath) if err != nil { return nil, fmt.Errorf("eval symlinks: %w", err) } pipelineName := fmt.Sprintf("host.directory %s", absPath) directoryPipeline := p.Add(pipeline.Pipeline{ Name: pipelineName, }) ctx, subRecorder := progrock.WithGroup(ctx, pipelineName) localID := fmt.Sprintf("host:%s", absPath) localOpts := []llb.LocalOption{ directoryPipeline.LLBOpt(), llb.WithCustomNamef("upload %s", absPath),
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
llb.SharedKeyHint(localID), llb.LocalUniqueID(localID), } if len(filter.Exclude) > 0 { localOpts = append(localOpts, llb.ExcludePatterns(filter.Exclude)) } if len(filter.Include) > 0 { localOpts = append(localOpts, llb.IncludePatterns(filter.Include)) } st := llb.Scratch().File( llb.Copy(llb.Local(absPath, localOpts...), "/", "/"), directoryPipeline.LLBOpt(), llb.WithCustomNamef("copy %s", absPath), ) def, err := st.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, err } defPB := def.ToPB() recordVertexes(subRecorder, defPB) return NewDirectory(ctx, defPB, "", p, platform, nil), nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
func (host *Host) Socket(ctx context.Context, sockPath string) (*Socket, error) { if host.DisableRW { return nil, ErrHostRWDisabled } var absPath string var err error if filepath.IsAbs(sockPath) { absPath = sockPath } else { absPath = filepath.Join(host.Workdir, sockPath) if !strings.HasPrefix(absPath, host.Workdir) { return nil, fmt.Errorf("path %q escapes workdir; use an absolute path instead", sockPath) } } absPath, err = filepath.EvalSymlinks(absPath) if err != nil { return nil, fmt.Errorf("eval symlinks: %w", err) } return NewHostSocket(absPath), nil } func (host *Host) Export( ctx context.Context, export bkclient.ExportEntry, bkClient *bkclient.Client, solveOpts bkclient.SolveOpt, solveCh chan<- *bkclient.SolveStatus, buildFn bkgw.BuildFunc, ) error { if host.DisableRW { return ErrHostRWDisabled
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/host.go
} ch, wg := mirrorCh(solveCh) defer wg.Wait() solveOpts.Exports = []bkclient.ExportEntry{export} _, err := bkClient.Build(ctx, solveOpts, "", buildFn, ch) return err } func (host *Host) NormalizeDest(dest string) (string, error) { if filepath.IsAbs(dest) { return dest, nil } wd, err := filepath.EvalSymlinks(host.Workdir) if err != nil { return "", err } dest = filepath.Clean(filepath.Join(wd, dest)) if dest == wd { return dest, nil } if !strings.HasPrefix(filepath.ToSlash(dest), filepath.ToSlash(wd+"/")) { return "", fmt.Errorf("destination %q escapes workdir", dest) } return dest, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
package core import ( "context" "os" "path/filepath" "testing" "dagger.io/dagger" "github.com/stretchr/testify/require" ) func TestHostWorkdir(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
t.Parallel() dir := t.TempDir() err := os.WriteFile(filepath.Join(dir, "foo"), []byte("bar"), 0600) require.NoError(t, err) ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithWorkdir(dir)) require.NoError(t, err) defer c.Close() t.Run("contains the workdir's content", func(t *testing.T) { contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", c.Host().Directory(".")). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "foo\n", contents) }) t.Run("does NOT re-sync on each call", func(t *testing.T) { err := os.WriteFile(filepath.Join(dir, "fizz"), []byte("buzz"), 0600) require.NoError(t, err) contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", c.Host().Directory(".")). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "foo\n", contents) }) } func TestHostWorkdirExcludeInclude(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
t.Parallel() dir := t.TempDir() require.NoError(t, os.WriteFile(filepath.Join(dir, "a.txt"), []byte("1"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "b.txt"), []byte("2"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "c.txt.rar"), []byte("3"), 0600)) require.NoError(t, os.MkdirAll(filepath.Join(dir, "subdir"), 0755)) require.NoError(t, os.WriteFile(filepath.Join(dir, "subdir", "sub-file"), []byte("goodbye"), 0600)) ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithWorkdir(dir)) require.NoError(t, err) defer c.Close() t.Run("exclude", func(t *testing.T) { wd := c.Host().Directory(".", dagger.HostDirectoryOpts{ Exclude: []string{"*.rar"}, })
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", wd). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "a.txt\nb.txt\nsubdir\n", contents) }) t.Run("exclude directory", func(t *testing.T) { wd := c.Host().Directory(".", dagger.HostDirectoryOpts{ Exclude: []string{"subdir"}, }) contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", wd). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "a.txt\nb.txt\nc.txt.rar\n", contents) }) t.Run("include", func(t *testing.T) { wd := c.Host().Directory(".", dagger.HostDirectoryOpts{ Include: []string{"*.rar"}, }) contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", wd). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
require.Equal(t, "c.txt.rar\n", contents) }) t.Run("exclude overrides include", func(t *testing.T) { wd := c.Host().Directory(".", dagger.HostDirectoryOpts{ Include: []string{"*.txt"}, Exclude: []string{"b.txt"}, }) contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", wd). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "a.txt\n", contents) }) t.Run("include does not override exclude", func(t *testing.T) { wd := c.Host().Directory(".", dagger.HostDirectoryOpts{ Include: []string{"a.txt"}, Exclude: []string{"*.txt"}, }) contents, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/host", wd). WithExec([]string{"ls", "/host"}). Stdout(ctx) require.NoError(t, err) require.Equal(t, "", contents) }) } func TestHostDirectoryRelative(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
t.Parallel() dir := t.TempDir() require.NoError(t, os.WriteFile(filepath.Join(dir, "some-file"), []byte("hello"), 0600)) require.NoError(t, os.MkdirAll(filepath.Join(dir, "some-dir"), 0755)) require.NoError(t, os.WriteFile(filepath.Join(dir, "some-dir", "sub-file"), []byte("goodbye"), 0600)) ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithWorkdir(dir)) require.NoError(t, err) defer c.Close() t.Run(". is same as workdir", func(t *testing.T) { wdID1, err := c.Host().Directory(".").ID(ctx) require.NoError(t, err) wdID2, err := c.Host().Directory(".").ID(ctx) require.NoError(t, err) require.Equal(t, wdID1, wdID2) }) t.Run("./foo is relative to workdir", func(t *testing.T) { contents, err := c.Host().Directory("some-dir").Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, contents) }) t.Run("../ does not allow escaping", func(t *testing.T) { _, err := c.Host().Directory("../").ID(ctx) require.Error(t, err) require.NotContains(t, err.Error(), dir) }) } func TestHostDirectoryAbsolute(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
t.Parallel() dir := t.TempDir() require.NoError(t, os.WriteFile(filepath.Join(dir, "some-file"), []byte("hello"), 0600)) require.NoError(t, os.MkdirAll(filepath.Join(dir, "some-dir"), 0755)) require.NoError(t, os.WriteFile(filepath.Join(dir, "some-dir", "sub-file"), []byte("goodbye"), 0600)) ctx := context.Background() c, err := dagger.Connect(ctx, dagger.WithWorkdir(dir)) require.NoError(t, err) defer c.Close() entries, err := c.Host().Directory(filepath.Join(dir, "some-dir")).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) } func TestHostDirectoryExcludeInclude(t *testing.T) { t.Parallel() dir := t.TempDir() require.NoError(t, os.WriteFile(filepath.Join(dir, "a.txt"), []byte("1"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "b.txt"), []byte("2"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "c.txt.rar"), []byte("3"), 0600)) require.NoError(t, os.MkdirAll(filepath.Join(dir, "subdir"), 0755)) require.NoError(t, os.WriteFile(filepath.Join(dir, "subdir", "d.txt"), []byte("1"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "subdir", "e.txt"), []byte("2"), 0600)) require.NoError(t, os.WriteFile(filepath.Join(dir, "subdir", "f.txt.rar"), []byte("3"), 0600)) c, ctx := connect(t) defer c.Close() t.Run("exclude", func(t *testing.T) { entries, err := c.Host().Directory(dir, dagger.HostDirectoryOpts{
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
Exclude: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt", "b.txt", "subdir"}, entries) }) t.Run("include", func(t *testing.T) { entries, err := c.Host().Directory(dir, dagger.HostDirectoryOpts{ Include: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"c.txt.rar"}, entries) }) t.Run("exclude overrides include", func(t *testing.T) { entries, err := c.Host().Directory(dir, dagger.HostDirectoryOpts{ Include: []string{"*.txt"}, Exclude: []string{"b.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt"}, entries) }) t.Run("include does not override exclude", func(t *testing.T) { entries, err := c.Host().Directory(dir, dagger.HostDirectoryOpts{ Include: []string{"a.txt"}, Exclude: []string{"*.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{}, entries) }) } func TestHostVariable(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/integration/host_test.go
t.Parallel() require.NoError(t, os.Setenv("HELLO_TEST", "hello")) ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() secret := c.Host().EnvVariable("HELLO_TEST") varValue, err := secret.Value(ctx) require.NoError(t, err) require.Equal(t, "hello", varValue) env, err := c.Container(). From("alpine:3.16.2"). WithSecretVariable("SECRET", secret.Secret()). WithExec([]string{"env"}). Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "SECRET=***") }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/schema/host.go
package schema import ( "os" "github.com/dagger/dagger/core" "github.com/dagger/dagger/router" ) type hostSchema struct { *baseSchema host *core.Host } var _ router.ExecutableSchema = &hostSchema{} func (s *hostSchema) Name() string { return "host" }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/schema/host.go
func (s *hostSchema) Schema() string { return Host } func (s *hostSchema) Resolvers() router.Resolvers { return router.Resolvers{ "Query": router.ObjectResolver{ "host": router.PassthroughResolver, }, "Host": router.ObjectResolver{ "workdir": router.ToResolver(s.workdir), "directory": router.ToResolver(s.directory), "envVariable": router.ToResolver(s.envVariable), "unixSocket": router.ToResolver(s.socket), }, "HostVariable": router.ObjectResolver{ "value": router.ToResolver(s.envVariableValue), "secret": router.ToResolver(s.envVariableSecret), }, } } func (s *hostSchema) Dependencies() []router.ExecutableSchema { return nil } type hostWorkdirArgs struct { core.CopyFilter } func (s *hostSchema) workdir(ctx *router.Context, parent *core.Query, args hostWorkdirArgs) (*core.Directory, error) { return s.host.Directory(ctx, ".", parent.PipelinePath(), s.platform, args.CopyFilter) } type hostVariableArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
core/schema/host.go
Name string } func (s *hostSchema) envVariable(ctx *router.Context, parent any, args hostVariableArgs) (*core.HostVariable, error) { return &core.HostVariable{ Name: args.Name, }, nil } func (s *hostSchema) envVariableValue(ctx *router.Context, parent *core.HostVariable, args any) (string, error) { return os.Getenv(parent.Name), nil } func (s *hostSchema) envVariableSecret(ctx *router.Context, parent *core.HostVariable, args any) (*core.Secret, error) { return core.NewSecretFromHostEnv(parent.Name), nil } type hostDirectoryArgs struct { Path string core.CopyFilter } func (s *hostSchema) directory(ctx *router.Context, parent *core.Query, args hostDirectoryArgs) (*core.Directory, error) { return s.host.Directory(ctx, args.Path, parent.PipelinePath(), s.platform, args.CopyFilter) } type hostSocketArgs struct { Path string } func (s *hostSchema) socket(ctx *router.Context, parent any, args hostSocketArgs) (*core.Socket, error) { return s.host.Socket(ctx, args.Path) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
package dagger import ( "context" "dagger.io/dagger/internal/querybuilder" "github.com/Khan/genqlient/graphql" ) type CacheID string type ContainerID string type DirectoryID string type FileID string type Platform string type ProjectCommandID string type ProjectID string type SecretID string type SocketID string type BuildArg struct { Name string `json:"name"` Value string `json:"value"` } type PipelineLabel struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Name string `json:"name"` Value string `json:"value"` } type CacheVolume struct { q *querybuilder.Selection c graphql.Client id *CacheID } func (r *CacheVolume) ID(ctx context.Context) (CacheID, error) { if r.id != nil { return *r.id, nil } q := r.q.Select("id") var response CacheID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *CacheVolume) XXX_GraphQLType() string { return "CacheVolume" } func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client endpoint *string envVariable *string exitCode *int export *bool hostname *string id *ContainerID imageRef *string label *string platform *Platform publish *string stderr *string stdout *string sync *ContainerID user *string workdir *string } type WithContainerFunc func(r *Container) *Container func (r *Container) With(f WithContainerFunc) *Container { return f(r) } type ContainerBuildOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Dockerfile string BuildArgs []BuildArg Target string Secrets []*Secret } func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container { q := r.q.Select("build") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile) } if !querybuilder.IsZeroValue(opts[i].BuildArgs) { q = q.Arg("buildArgs", opts[i].BuildArgs) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
if !querybuilder.IsZeroValue(opts[i].Target) { q = q.Arg("target", opts[i].Target) } if !querybuilder.IsZeroValue(opts[i].Secrets) { q = q.Arg("secrets", opts[i].Secrets) } } q = q.Arg("context", context) return &Container{ q: q, c: r.c, } } func (r *Container) DefaultArgs(ctx context.Context) ([]string, error) { q := r.q.Select("defaultArgs") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type ContainerEndpointOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Port int Scheme string } func (r *Container) Endpoint(ctx context.Context, opts ...ContainerEndpointOpts) (string, error) { if r.endpoint != nil { return *r.endpoint, nil } q := r.q.Select("endpoint") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Port) { q = q.Arg("port", opts[i].Port)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} if !querybuilder.IsZeroValue(opts[i].Scheme) { q = q.Arg("scheme", opts[i].Scheme) } } var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Entrypoint(ctx context.Context) ([]string, error) { q := r.q.Select("entrypoint") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariable(ctx context.Context, name string) (string, error) { if r.envVariable != nil { return *r.envVariable, nil } q := r.q.Select("envVariable") q = q.Arg("name", name) var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error) { q := r.q.Select("envVariables") q = q.Select("name value") type envVariables struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Name string Value string } convert := func(fields []envVariables) []EnvVariable { out := []EnvVariable{} for i := range fields { out = append(out, EnvVariable{name: &fields[i].Name, value: &fields[i].Value}) } return out } var response []envVariables q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } type ContainerExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Args []string Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } func (r *Container) Exec(opts ...ContainerExecOpts) *Container { q := r.q.Select("exec") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) } if !querybuilder.IsZeroValue(opts[i].Stdin) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q = q.Arg("stdin", opts[i].Stdin) } if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) } if !querybuilder.IsZeroValue(opts[i].RedirectStderr) { q = q.Arg("redirectStderr", opts[i].RedirectStderr) } if !querybuilder.IsZeroValue(opts[i].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) } } return &Container{ q: q, c: r.c, } } func (r *Container) ExitCode(ctx context.Context) (int, error) { if r.exitCode != nil { return *r.exitCode, nil } q := r.q.Select("exitCode") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerExportOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
PlatformVariants []*Container ForcedCompression ImageLayerCompression } func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error) { if r.export != nil { return *r.export, nil } q := r.q.Select("export") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) } if !querybuilder.IsZeroValue(opts[i].ForcedCompression) { q = q.Arg("forcedCompression", opts[i].ForcedCompression) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} q = q.Arg("path", path) var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) ExposedPorts(ctx context.Context) ([]Port, error) { q := r.q.Select("exposedPorts") q = q.Select("description port protocol") type exposedPorts struct { Description string Port int Protocol NetworkProtocol } convert := func(fields []exposedPorts) []Port { out := []Port{} for i := range fields { out = append(out, Port{description: &fields[i].Description, port: &fields[i].Port, protocol: &fields[i].Protocol}) } return out } var response []exposedPorts q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } func (r *Container) File(path string) *File {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q := r.q.Select("file") q = q.Arg("path", path) return &File{ q: q, c: r.c, } } func (r *Container) From(address string) *Container { q := r.q.Select("from") q = q.Arg("address", address) return &Container{ q: q, c: r.c, } } func (r *Container) FS() *Directory { q := r.q.Select("fs") return &Directory{ q: q, c: r.c, } } func (r *Container) Hostname(ctx context.Context) (string, error) { if r.hostname != nil { return *r.hostname, nil } q := r.q.Select("hostname") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} func (r *Container) ID(ctx context.Context) (ContainerID, error) { if r.id != nil { return *r.id, nil } q := r.q.Select("id") var response ContainerID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) XXX_GraphQLType() string { return "Container" } func (r *Container) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *Container) ImageRef(ctx context.Context) (string, error) { if r.imageRef != nil { return *r.imageRef, nil } q := r.q.Select("imageRef") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerImportOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Tag string } func (r *Container) Import(source *File, opts ...ContainerImportOpts) *Container { q := r.q.Select("import") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Tag) { q = q.Arg("tag", opts[i].Tag) } } q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) Label(ctx context.Context, name string) (string, error) { if r.label != nil { return *r.label, nil } q := r.q.Select("label") q = q.Arg("name", name) var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} func (r *Container) Labels(ctx context.Context) ([]Label, error) { q := r.q.Select("labels") q = q.Select("name value") type labels struct { Name string Value string } convert := func(fields []labels) []Label { out := []Label{} for i := range fields { out = append(out, Label{name: &fields[i].Name, value: &fields[i].Value}) } return out } var response []labels q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } func (r *Container) Mounts(ctx context.Context) ([]string, error) { q := r.q.Select("mounts") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerPipelineOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Description string Labels []PipelineLabel } func (r *Container) Pipeline(name string, opts ...ContainerPipelineOpts) *Container { q := r.q.Select("pipeline") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Description) { q = q.Arg("description", opts[i].Description) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
if !querybuilder.IsZeroValue(opts[i].Labels) { q = q.Arg("labels", opts[i].Labels) } } q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) Platform(ctx context.Context) (Platform, error) { if r.platform != nil { return *r.platform, nil } q := r.q.Select("platform") var response Platform q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerPublishOpts struct { PlatformVariants []*Container ForcedCompression ImageLayerCompression
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error) { if r.publish != nil { return *r.publish, nil } q := r.q.Select("publish") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) } if !querybuilder.IsZeroValue(opts[i].ForcedCompression) { q = q.Arg("forcedCompression", opts[i].ForcedCompression) } } q = q.Arg("address", address) var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Rootfs() *Directory { q := r.q.Select("rootfs") return &Directory{ q: q, c: r.c, } } func (r *Container) Stderr(ctx context.Context) (string, error) { if r.stderr != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return *r.stderr, nil } q := r.q.Select("stderr") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Stdout(ctx context.Context) (string, error) { if r.stdout != nil { return *r.stdout, nil } q := r.q.Select("stdout") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Sync(ctx context.Context) (*Container, error) { q := r.q.Select("sync") return r, q.Execute(ctx, r.c) } func (r *Container) User(ctx context.Context) (string, error) { if r.user != nil { return *r.user, nil } q := r.q.Select("user") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerWithDefaultArgsOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Args []string } func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container { q := r.q.Select("withDefaultArgs") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) } } return &Container{ q: q, c: r.c, } } type ContainerWithDirectoryOpts struct { Exclude []string Include []string Owner string } func (r *Container) WithDirectory(path string, directory *Directory, opts ...ContainerWithDirectoryOpts) *Container { q := r.q.Select("withDirectory")
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) } if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) } if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("directory", directory) return &Container{ q: q, c: r.c, } } func (r *Container) WithEntrypoint(args []string) *Container { q := r.q.Select("withEntrypoint") q = q.Arg("args", args) return &Container{ q: q, c: r.c, } } type ContainerWithEnvVariableOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Expand bool } func (r *Container) WithEnvVariable(name string, value string, opts ...ContainerWithEnvVariableOpts) *Container { q := r.q.Select("withEnvVariable") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Expand) { q = q.Arg("expand", opts[i].Expand) } } q = q.Arg("name", name) q = q.Arg("value", value) return &Container{ q: q, c: r.c, } } type ContainerWithExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
SkipEntrypoint bool Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool InsecureRootCapabilities bool } func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container { q := r.q.Select("withExec") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].SkipEntrypoint) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q = q.Arg("skipEntrypoint", opts[i].SkipEntrypoint) } if !querybuilder.IsZeroValue(opts[i].Stdin) { q = q.Arg("stdin", opts[i].Stdin) } if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) } if !querybuilder.IsZeroValue(opts[i].RedirectStderr) { q = q.Arg("redirectStderr", opts[i].RedirectStderr) } if !querybuilder.IsZeroValue(opts[i].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) } if !querybuilder.IsZeroValue(opts[i].InsecureRootCapabilities) { q = q.Arg("insecureRootCapabilities", opts[i].InsecureRootCapabilities) } } q = q.Arg("args", args) return &Container{ q: q, c: r.c, } } type ContainerWithExposedPortOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Protocol NetworkProtocol Description string } func (r *Container) WithExposedPort(port int, opts ...ContainerWithExposedPortOpts) *Container { q := r.q.Select("withExposedPort") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Protocol) { q = q.Arg("protocol", opts[i].Protocol) } if !querybuilder.IsZeroValue(opts[i].Description) { q = q.Arg("description", opts[i].Description) } } q = q.Arg("port", port) return &Container{ q: q, c: r.c,
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} } func (r *Container) WithFS(id *Directory) *Container { q := r.q.Select("withFS") q = q.Arg("id", id) return &Container{ q: q, c: r.c, } } type ContainerWithFileOpts struct { Permissions int Owner string } func (r *Container) WithFile(path string, source *File, opts ...ContainerWithFileOpts) *Container { q := r.q.Select("withFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithLabel(name string, value string) *Container { q := r.q.Select("withLabel") q = q.Arg("name", name) q = q.Arg("value", value) return &Container{ q: q, c: r.c, } } type ContainerWithMountedCacheOpts struct { Source *Directory Sharing CacheSharingMode
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Owner string } func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container { q := r.q.Select("withMountedCache") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Source) { q = q.Arg("source", opts[i].Source) } if !querybuilder.IsZeroValue(opts[i].Sharing) { q = q.Arg("sharing", opts[i].Sharing) } if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("cache", cache) return &Container{ q: q, c: r.c, } } type ContainerWithMountedDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Owner string } func (r *Container) WithMountedDirectory(path string, source *Directory, opts ...ContainerWithMountedDirectoryOpts) *Container { q := r.q.Select("withMountedDirectory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } type ContainerWithMountedFileOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Owner string } func (r *Container) WithMountedFile(path string, source *File, opts ...ContainerWithMountedFileOpts) *Container { q := r.q.Select("withMountedFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } type ContainerWithMountedSecretOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Owner string } func (r *Container) WithMountedSecret(path string, source *Secret, opts ...ContainerWithMountedSecretOpts) *Container { q := r.q.Select("withMountedSecret") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedTemp(path string) *Container { q := r.q.Select("withMountedTemp") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
type ContainerWithNewFileOpts struct { Contents string Permissions int Owner string } func (r *Container) WithNewFile(path string, opts ...ContainerWithNewFileOpts) *Container { q := r.q.Select("withNewFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Contents) { q = q.Arg("contents", opts[i].Contents) } if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) } if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithRegistryAuth(address string, username string, secret *Secret) *Container { q := r.q.Select("withRegistryAuth") q = q.Arg("address", address) q = q.Arg("username", username) q = q.Arg("secret", secret) return &Container{ q: q, c: r.c, } } func (r *Container) WithRootfs(id *Directory) *Container { q := r.q.Select("withRootfs") q = q.Arg("id", id) return &Container{ q: q, c: r.c, } } func (r *Container) WithSecretVariable(name string, secret *Secret) *Container { q := r.q.Select("withSecretVariable") q = q.Arg("name", name) q = q.Arg("secret", secret) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
c: r.c, } } func (r *Container) WithServiceBinding(alias string, service *Container) *Container { q := r.q.Select("withServiceBinding") q = q.Arg("alias", alias) q = q.Arg("service", service) return &Container{ q: q, c: r.c, } } type ContainerWithUnixSocketOpts struct { Owner string } func (r *Container) WithUnixSocket(path string, source *Socket, opts ...ContainerWithUnixSocketOpts) *Container { q := r.q.Select("withUnixSocket") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Owner) { q = q.Arg("owner", opts[i].Owner) } } q = q.Arg("path", path) q = q.Arg("source", source)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return &Container{ q: q, c: r.c, } } func (r *Container) WithUser(name string) *Container { q := r.q.Select("withUser") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) WithWorkdir(path string) *Container { q := r.q.Select("withWorkdir") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutEnvVariable(name string) *Container { q := r.q.Select("withoutEnvVariable") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } type ContainerWithoutExposedPortOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Protocol NetworkProtocol } func (r *Container) WithoutExposedPort(port int, opts ...ContainerWithoutExposedPortOpts) *Container { q := r.q.Select("withoutExposedPort") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Protocol) { q = q.Arg("protocol", opts[i].Protocol) } } q = q.Arg("port", port) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutLabel(name string) *Container { q := r.q.Select("withoutLabel") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutMount(path string) *Container { q := r.q.Select("withoutMount") q = q.Arg("path", path) return &Container{
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q: q, c: r.c, } } func (r *Container) WithoutRegistryAuth(address string) *Container { q := r.q.Select("withoutRegistryAuth") q = q.Arg("address", address) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutUnixSocket(path string) *Container { q := r.q.Select("withoutUnixSocket") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) Workdir(ctx context.Context) (string, error) { if r.workdir != nil { return *r.workdir, nil } q := r.q.Select("workdir") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Directory struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client export *bool id *DirectoryID } type WithDirectoryFunc func(r *Directory) *Directory func (r *Directory) With(f WithDirectoryFunc) *Directory { return f(r) } func (r *Directory) Diff(other *Directory) *Directory { q := r.q.Select("diff") q = q.Arg("other", other) return &Directory{ q: q, c: r.c, } } func (r *Directory) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type DirectoryDockerBuildOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Dockerfile string Platform Platform BuildArgs []BuildArg Target string Secrets []*Secret }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
func (r *Directory) DockerBuild(opts ...DirectoryDockerBuildOpts) *Container { q := r.q.Select("dockerBuild") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile) } if !querybuilder.IsZeroValue(opts[i].Platform) { q = q.Arg("platform", opts[i].Platform) } if !querybuilder.IsZeroValue(opts[i].BuildArgs) { q = q.Arg("buildArgs", opts[i].BuildArgs) } if !querybuilder.IsZeroValue(opts[i].Target) { q = q.Arg("target", opts[i].Target) } if !querybuilder.IsZeroValue(opts[i].Secrets) { q = q.Arg("secrets", opts[i].Secrets) } } return &Container{ q: q, c: r.c, } } type DirectoryEntriesOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Path string } func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error) { q := r.q.Select("entries") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Path) { q = q.Arg("path", opts[i].Path) } } var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) Export(ctx context.Context, path string) (bool, error) { if r.export != nil { return *r.export, nil } q := r.q.Select("export") q = q.Arg("path", path) var response bool q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *Directory) File(path string) *File { q := r.q.Select("file") q = q.Arg("path", path) return &File{ q: q, c: r.c, } } func (r *Directory) ID(ctx context.Context) (DirectoryID, error) { if r.id != nil { return *r.id, nil } q := r.q.Select("id") var response DirectoryID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) XXX_GraphQLType() string { return "Directory" } func (r *Directory) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } type DirectoryPipelineOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Description string Labels []PipelineLabel } func (r *Directory) Pipeline(name string, opts ...DirectoryPipelineOpts) *Directory { q := r.q.Select("pipeline") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Description) { q = q.Arg("description", opts[i].Description) } if !querybuilder.IsZeroValue(opts[i].Labels) { q = q.Arg("labels", opts[i].Labels) } } q = q.Arg("name", name) return &Directory{ q: q, c: r.c, } } type DirectoryWithDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory { q := r.q.Select("withDirectory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) } if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) } } q = q.Arg("path", path) q = q.Arg("directory", directory) return &Directory{ q: q, c: r.c, } } type DirectoryWithFileOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Permissions int } func (r *Directory) WithFile(path string, source *File, opts ...DirectoryWithFileOpts) *Directory { q := r.q.Select("withFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) } } q = q.Arg("path", path) q = q.Arg("source", source) return &Directory{ q: q, c: r.c, } } type DirectoryWithNewDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Permissions int } func (r *Directory) WithNewDirectory(path string, opts ...DirectoryWithNewDirectoryOpts) *Directory { q := r.q.Select("withNewDirectory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) } } q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type DirectoryWithNewFileOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Permissions int } func (r *Directory) WithNewFile(path string, contents string, opts ...DirectoryWithNewFileOpts) *Directory { q := r.q.Select("withNewFile") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Permissions) { q = q.Arg("permissions", opts[i].Permissions) } } q = q.Arg("path", path) q = q.Arg("contents", contents)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return &Directory{ q: q, c: r.c, } } func (r *Directory) WithTimestamps(timestamp int) *Directory { q := r.q.Select("withTimestamps") q = q.Arg("timestamp", timestamp) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutDirectory(path string) *Directory { q := r.q.Select("withoutDirectory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutFile(path string) *Directory { q := r.q.Select("withoutFile") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type EnvVariable struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client name *string value *string } func (r *EnvVariable) Name(ctx context.Context) (string, error) { if r.name != nil { return *r.name, nil } q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *EnvVariable) Value(ctx context.Context) (string, error) { if r.value != nil { return *r.value, nil } q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type File struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client contents *string export *bool id *FileID size *int } func (r *File) Contents(ctx context.Context) (string, error) { if r.contents != nil { return *r.contents, nil } q := r.q.Select("contents") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) Export(ctx context.Context, path string) (bool, error) { if r.export != nil { return *r.export, nil } q := r.q.Select("export") q = q.Arg("path", path) var response bool q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *File) ID(ctx context.Context) (FileID, error) { if r.id != nil { return *r.id, nil } q := r.q.Select("id") var response FileID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) XXX_GraphQLType() string { return "File" } func (r *File) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *File) Secret() *Secret { q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *File) Size(ctx context.Context) (int, error) { if r.size != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return *r.size, nil } q := r.q.Select("size") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) WithTimestamps(timestamp int) *File { q := r.q.Select("withTimestamps") q = q.Arg("timestamp", timestamp) return &File{ q: q, c: r.c, } } type GitRef struct { q *querybuilder.Selection c graphql.Client digest *string } func (r *GitRef) Digest(ctx context.Context) (string, error) { if r.digest != nil { return *r.digest, nil } q := r.q.Select("digest") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type GitRefTreeOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
SSHKnownHosts string SSHAuthSocket *Socket } func (r *GitRef) Tree(opts ...GitRefTreeOpts) *Directory { q := r.q.Select("tree") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].SSHKnownHosts) { q = q.Arg("sshKnownHosts", opts[i].SSHKnownHosts) } if !querybuilder.IsZeroValue(opts[i].SSHAuthSocket) { q = q.Arg("sshAuthSocket", opts[i].SSHAuthSocket) } } return &Directory{ q: q, c: r.c, } } type GitRepository struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *GitRepository) Branch(name string) *GitRef { q := r.q.Select("branch") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Branches(ctx context.Context) ([]string, error) { q := r.q.Select("branches") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *GitRepository) Commit(id string) *GitRef { q := r.q.Select("commit") q = q.Arg("id", id) return &GitRef{ q: q, c: r.c, }
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} func (r *GitRepository) Tag(name string) *GitRef { q := r.q.Select("tag") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Tags(ctx context.Context) ([]string, error) { q := r.q.Select("tags") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Host struct { q *querybuilder.Selection c graphql.Client } type HostDirectoryOpts struct { Exclude []string Include []string } func (r *Host) Directory(path string, opts ...HostDirectoryOpts) *Directory { q := r.q.Select("directory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q = q.Arg("exclude", opts[i].Exclude) } if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) } } q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Host) EnvVariable(name string) *HostVariable { q := r.q.Select("envVariable") q = q.Arg("name", name) return &HostVariable{ q: q, c: r.c, } } func (r *Host) UnixSocket(path string) *Socket { q := r.q.Select("unixSocket") q = q.Arg("path", path) return &Socket{ q: q, c: r.c, } } type HostWorkdirOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Host) Workdir(opts ...HostWorkdirOpts) *Directory { q := r.q.Select("workdir") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) } if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) } } return &Directory{ q: q, c: r.c, } } type HostVariable struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client value *string } func (r *HostVariable) Secret() *Secret { q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *HostVariable) Value(ctx context.Context) (string, error) { if r.value != nil { return *r.value, nil } q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Label struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client name *string value *string } func (r *Label) Name(ctx context.Context) (string, error) { if r.name != nil { return *r.name, nil } q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Label) Value(ctx context.Context) (string, error) { if r.value != nil { return *r.value, nil } q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Port struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client description *string port *int protocol *NetworkProtocol } func (r *Port) Description(ctx context.Context) (string, error) { if r.description != nil { return *r.description, nil } q := r.q.Select("description") var response string q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *Port) Port(ctx context.Context) (int, error) { if r.port != nil { return *r.port, nil } q := r.q.Select("port") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Port) Protocol(ctx context.Context) (NetworkProtocol, error) { if r.protocol != nil { return *r.protocol, nil } q := r.q.Select("protocol") var response NetworkProtocol q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Project struct { q *querybuilder.Selection c graphql.Client id *string name *string } func (r *Project) Commands(ctx context.Context) ([]ProjectCommand, error) { q := r.q.Select("commands") q = q.Select("description id name") type commands struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Description string Id string Name string } convert := func(fields []commands) []ProjectCommand { out := []ProjectCommand{} for i := range fields { out = append(out, ProjectCommand{description: &fields[i].Description, id: &fields[i].Id, name: &fields[i].Name}) } return out } var response []commands q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } func (r *Project) ID(ctx context.Context) (string, error) { if r.id != nil { return *r.id, nil } q := r.q.Select("id") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c)
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
} func (r *Project) XXX_GraphQLType() string { return "Project" } func (r *Project) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *Project) Load(source *Directory, configPath string) *Project { q := r.q.Select("load") q = q.Arg("source", source) q = q.Arg("configPath", configPath) return &Project{ q: q, c: r.c, } } func (r *Project) Name(ctx context.Context) (string, error) { if r.name != nil { return *r.name, nil } q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ProjectCommand struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client description *string id *string name *string } func (r *ProjectCommand) Description(ctx context.Context) (string, error) { if r.description != nil { return *r.description, nil } q := r.q.Select("description") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *ProjectCommand) Flags(ctx context.Context) ([]ProjectCommandFlag, error) { q := r.q.Select("flags") q = q.Select("description name") type flags struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Description string Name string } convert := func(fields []flags) []ProjectCommandFlag { out := []ProjectCommandFlag{} for i := range fields { out = append(out, ProjectCommandFlag{description: &fields[i].Description, name: &fields[i].Name}) } return out } var response []flags q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } func (r *ProjectCommand) ID(ctx context.Context) (string, error) { if r.id != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
return *r.id, nil } q := r.q.Select("id") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *ProjectCommand) XXX_GraphQLType() string { return "ProjectCommand" } func (r *ProjectCommand) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *ProjectCommand) Name(ctx context.Context) (string, error) { if r.name != nil { return *r.name, nil } q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *ProjectCommand) Subcommands(ctx context.Context) ([]ProjectCommand, error) { q := r.q.Select("subcommands") q = q.Select("description id name") type subcommands struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
Description string Id string Name string } convert := func(fields []subcommands) []ProjectCommand { out := []ProjectCommand{} for i := range fields { out = append(out, ProjectCommand{description: &fields[i].Description, id: &fields[i].Id, name: &fields[i].Name}) } return out } var response []subcommands q = q.Bind(&response) err := q.Execute(ctx, r.c) if err != nil { return nil, err } return convert(response), nil } type ProjectCommandFlag struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,745
✨ `(*dagger.Client).Host().Directory(...)` equivalent for a `*dagger.File`
### What are you trying to do? I am using `container.WithMountedFile` but `Host()` only lets me retrieve a `*dagger.Directory`, and there is no equivalent for a `*dagger.File` ### Why is this important to you? It would be nice to have and would eliminate some boilerplate :) ### How are you currently working around this? Right now I'm doing ```go path := "/path/to/my/file.txt" file := client.Host().Directory(filepath.Dir(path)).File(filepath.Base(path)) client.Container().From("alpine").WithFile("/file.txt", file) ```
https://github.com/dagger/dagger/issues/4745
https://github.com/dagger/dagger/pull/5317
3df28c2ba50452ed4df7ed2693ae97611428a007
a89a7c3cc34bdb4c15cbdbe415b491157717d14d
2023-03-09T21:56:42Z
go
2023-06-15T19:10:03Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client description *string name *string } func (r *ProjectCommandFlag) Description(ctx context.Context) (string, error) { if r.description != nil { return *r.description, nil } q := r.q.Select("description") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *ProjectCommandFlag) Name(ctx context.Context) (string, error) { if r.name != nil { return *r.name, nil } q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Client) CacheVolume(key string) *CacheVolume { q := r.q.Select("cacheVolume") q = q.Arg("key", key) return &CacheVolume{ q: q, c: r.c,