Skip to content
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

Remove Authenticate call from TF Configure #3100

Merged
merged 4 commits into from
Jan 12, 2024
Merged

Remove Authenticate call from TF Configure #3100

merged 4 commits into from
Jan 12, 2024

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Jan 10, 2024

Changes

Now that the SDK always uses context.Background() for refreshing OAuth tokens, we don't need to authenticate in the provider configure method with a background context anymore. This removes the need to handle edge cases in the provider configure method around authentication failures, like that described in #3023.

Resolves #3023.

Tests

Applied the following template using OAuth-M2M authentication:

resource "databricks_notebook" "example" {
    content_base64 = base64encode(<<-EOT
        # created from ${abspath(path.module)}
        display(spark.range(3))
        EOT
    )
    language = "PYTHON"
    path = "/Shared/HelloWorld"
}
resource "time_sleep" "wait_2_hours" {
  depends_on = [databricks_notebook.previous]

  create_duration = "2h"
}
resource "databricks_notebook" "example2" {
    content_base64 = base64encode(<<-EOT
        # created from ${abspath(path.module)}
        display(spark.range(4))
        EOT
    )
    language = "PYTHON"
    path = "/Shared/HelloWorldAfterWait"
    depends_on = [ time_sleep.wait_2_hours ]
}

This should be long enough that the OAuth token expires and a new access token is retrieved to update the last notebook.

@mgyucht mgyucht requested review from a team as code owners January 10, 2024 15:37
@mgyucht mgyucht requested review from hectorcast-db and removed request for a team January 10, 2024 15:37
@mgyucht mgyucht requested a review from alexott January 12, 2024 14:33
@shreyas-goenka shreyas-goenka self-requested a review January 12, 2024 14:33
Copy link
Contributor

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mgyucht mgyucht added this pull request to the merge queue Jan 12, 2024
@shreyas-goenka shreyas-goenka removed their request for review January 12, 2024 14:42
Merged via the queue into master with commit f46eed6 Jan 12, 2024
5 checks passed
@mgyucht mgyucht deleted the issue-3023 branch January 12, 2024 14:48
@hectorcast-db hectorcast-db mentioned this pull request Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ISSUE] Issue with databricks_1.31.1 provider invalid Configuration
3 participants