Skip to content

Commit

Permalink
Fix bundle arg
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Oct 24, 2024
1 parent 56619bf commit 8c4abea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions bundle/run/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"

"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/config/resources"
refs "github.com/databricks/cli/bundle/resources"
"github.com/databricks/cli/bundle/run/output"
Expand Down Expand Up @@ -45,12 +46,12 @@ func IsRunnable(ref refs.Reference) bool {
}

// ToRunner converts a resource reference to a runnable resource.
func ToRunner(ref refs.Reference) (Runner, error) {
func ToRunner(b *bundle.Bundle, ref refs.Reference) (Runner, error) {
switch resource := ref.Resource.(type) {
case *resources.Job:
return &jobRunner{key: key(ref.KeyWithType), job: resource}, nil
return &jobRunner{key: key(ref.KeyWithType), bundle: b, job: resource}, nil
case *resources.Pipeline:
return &pipelineRunner{key: key(ref.KeyWithType), pipeline: resource}, nil
return &pipelineRunner{key: key(ref.KeyWithType), bundle: b, pipeline: resource}, nil
default:
return nil, fmt.Errorf("unsupported resource type: %T", resource)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/bundle/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func keyToRunner(b *bundle.Bundle, arg string) (run.Runner, error) {
}

// Convert the resource to a runnable resource.
runner, err := run.ToRunner(ref)
runner, err := run.ToRunner(b, ref)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8c4abea

Please sign in to comment.