Skip to content

Commit

Permalink
Dataproc workflow template (#4693) (#687)
Browse files Browse the repository at this point in the history
* Update eventarc trigger yaml, markdown to allow setting transport

* Update test, add handwritten utils

* Update handwritten

* Updating eventarc test

* Updating trigger

* Adding dataproc workflow

* Updating expanders

* Updates to prop, resource to handle refs

* Add support for workflow in GA

* fix merge issues

* Add template markdown

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Apr 20, 2021
1 parent 137f61a commit 7cf46d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"google.golang.org/api/option"

dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
dataprocDcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/dataproc"
eventarcDcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/eventarc"
"golang.org/x/oauth2"
googleoauth "golang.org/x/oauth2/google"
Expand Down Expand Up @@ -163,6 +164,7 @@ type Config struct {

// start DCL clients
dclConfig *dcl.Config
clientDataprocDCL *dataprocDcl.Client
clientEventarcDCL *eventarcDcl.Client
}

Expand Down Expand Up @@ -284,6 +286,7 @@ func (c *Config) LoadAndValidate(ctx context.Context) error {
// Start DCL client instantiation
// TODO(slevenick): handle user agents
c.dclConfig = dcl.NewConfig(dcl.WithHTTPClient(client), dcl.WithUserAgent(c.userAgent), dcl.WithLogger(dclLogger{}))
c.clientDataprocDCL = dataprocDcl.NewClient(c.dclConfig)
c.clientEventarcDCL = eventarcDcl.NewClient(c.dclConfig)

return nil
Expand Down
16 changes: 8 additions & 8 deletions google/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,6 @@ func SnakeToPascalCase(s string) string {
return strings.Join(split, "")
}

func checkStringMap(v interface{}) map[string]string {
m, ok := v.(map[string]string)
if ok {
return m
}
return convertStringMap(v.(map[string]interface{}))
}

func multiEnvSearch(ks []string) string {
for _, k := range ks {
if v := os.Getenv(k); v != "" {
Expand All @@ -498,3 +490,11 @@ func multiEnvSearch(ks []string) string {
}
return ""
}

func checkStringMap(v interface{}) map[string]string {
m, ok := v.(map[string]string)
if ok {
return m
}
return convertStringMap(v.(map[string]interface{}))
}

0 comments on commit 7cf46d8

Please sign in to comment.