-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new workspace_url format + fix azure test #114
Use new workspace_url format + fix azure test #114
Conversation
again thank you @lawrencegripper @EliiseS for picking this up! |
Codecov Report
@@ Coverage Diff @@
## master #114 +/- ##
==========================================
+ Coverage 47.98% 48.02% +0.04%
==========================================
Files 58 58
Lines 7228 7219 -9
==========================================
- Hits 3468 3467 -1
+ Misses 3700 3690 -10
- Partials 60 62 +2
|
@stikkireddy |
Co-authored-by: Lawrence Gripper <[email protected]>
Just investigating some odd behavior with this change. Lets not merge until we've got to the bottom of it. |
@stikkireddy The odd behaviour we were investigating concluded in #119, which, while not great, isn't blocking this issue. Are you happy to merge this PR? |
@EliiseS on the above comment regarding turning the azure_auth into a list/set rather than a map, would you like to make that another PR? If you would like to move it outside of the scope of this PR we can merge this in please let me know. |
@stikkireddy I actually looked into doing that and I was unable to get the tests to work with it. Let's move that discussion to another issue. I'm waiting for clarification from terraform in this PR: hashicorp/terraform-plugin-sdk#142 |
awesome that is fine @EliiseS , I added a comment on that issue by the way. |
…seS/databricks-terraform into es-lg/Use-new-workspace-url
Hey @EliiseS one last comment I would like to add:
func (a *AzureAuth) getWorkspaceID(config *service.DBApiClientConfig) error {
log.Println("[DEBUG] Getting Workspace ID via management token.")
// Escape all the ids
url := fmt.Sprintf("https://management.azure.com/subscriptions/%s/resourceGroups/%s"+
"/providers/Microsoft.Databricks/workspaces/%s",
urlParse.PathEscape(a.TokenPayload.SubscriptionID),
urlParse.PathEscape(a.TokenPayload.ResourceGroup),
urlParse.PathEscape(a.TokenPayload.WorkspaceName))
headers := map[string]string{
"Content-Type": "application/json",
"cache-control": "no-cache",
"Authorization": "Bearer " + a.ManagementToken,
}
type apiVersion struct {
APIVersion string `url:"api-version"`
}
uriPayload := apiVersion{
APIVersion: "2018-04-01",
}
var responseMap map[string]interface{}
resp, err := service.PerformQuery(config, http.MethodGet, url, "2.0", headers, false, true, uriPayload, nil)
if err != nil {
return err
}
err = json.Unmarshal(resp, &responseMap)
if err != nil {
return err
}
a.AdbWorkspaceResourceID = responseMap["id"].(string)
return err
} |
…seS/databricks-terraform into es-lg/Use-new-workspace-url
Co-authored-by: Stuart Leeks <[email protected]>
@@ -48,10 +48,13 @@ vendor: | |||
@echo "==> Filling vendor folder with library code..." | |||
@go mod vendor | |||
|
|||
local-install: build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not be fully idempotent, when there are other db provider files there already, possibly with different names. I'd suggest to clear all files starting with terraform-provider-databricks and then do the move.
i'd suggest to rename target to simply install
, following make install
mantra :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr has been merged. I can make these changes in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this command in another pr #129 considering that the version is hardcoded there for local install. If we want to make an install target for the makefile we can work on that in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other providers have a script to create a binary from the local files as well. It's very useful for testing and trying out your changes. Why is the hard-coded version number a problem enough that you'd remove the addition? How would you like to set a version number instead?
Implementation of the issue: #34
Co-authored-by: [email protected]
[email protected]