LeoCBS commented on PR #33236:
URL: https://github.com/apache/beam/pull/33236#issuecomment-2558626254
@lostluck check if i understand your suggestion:
in file sdks/go/pkg/beam/io/filesystem/gcs/gcs.go i will register a hook to
get billing project information:
```
var (
billingProject string = ""
)
func init() {
hf := func(opts []string) hooks.Hook {
return hooks.Hook{
Init: func(ctx context.Context) (context.Context,
error) {
if len(opts) == 0 {
return ctx, nil
}
if len(opts) > 1 {
return ctx, fmt.Errorf("expected 1
option, got %v: %v", len(opts), opts)
}
billingProject = opts[0]
return ctx, nil
},
}
}
hooks.RegisterHook("beam:go:hook:gcstorage:requesterbillingproject", hf)
}
```
and on beam/sdks/go/pkg/beam/util/harnessopts/gcs.go i will create a
function like this?
```
const (
billingProjectHook = "beam:go:hook:requesterbillingproject:capacity"
)
func SetRequesterBillingProject(billingProject string) error {
return hooks.EnableHook(billingProjectHook, billingProject)
}
```
I have some questions:
* who will call function SetRequesterBillingProject?
* How will i test if hook was called correcty?
* Will i passing billing project by CLI args? like the runner value,
`--runner dataflow`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]