mirror of https://github.com/databricks/cli.git
Use `service.NamedIdMap` to make lookup generation deterministic (#1678)
## Changes Relies on this PR from Go SDK https://github.com/databricks/databricks-sdk-go/pull/1016 See explanation there
This commit is contained in:
parent
53041346f2
commit
f32902dc04
|
@ -116,12 +116,12 @@ func allResolvers() *resolvers {
|
|||
{{range .Services -}}
|
||||
{{- if in $allowlist .KebabName -}}
|
||||
r.{{.Singular.PascalName}} = func(ctx context.Context, w *databricks.WorkspaceClient, name string) (string, error) {
|
||||
entity, err := w.{{.PascalName}}.GetBy{{range .List.NamedIdMap.NamePath}}{{.PascalName}}{{end}}(ctx, name)
|
||||
entity, err := w.{{.PascalName}}.GetBy{{range .NamedIdMap.NamePath}}{{.PascalName}}{{end}}(ctx, name)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return fmt.Sprint(entity.{{ getOrDefault $customField .KebabName ((index .List.NamedIdMap.IdPath 0).PascalName) }}), nil
|
||||
return fmt.Sprint(entity.{{ getOrDefault $customField .KebabName ((index .NamedIdMap.IdPath 0).PascalName) }}), nil
|
||||
}
|
||||
{{end -}}
|
||||
{{- end}}
|
||||
|
|
Loading…
Reference in New Issue