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

Fixed databricks_job recreation on changed docker_image URL #1437

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clusters/clusters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ type LogSyncStatus struct {

// DockerBasicAuth contains the auth information when fetching containers
type DockerBasicAuth struct {
Username string `json:"username" tf:"force_new"`
Password string `json:"password" tf:"force_new"`
Username string `json:"username"`
Password string `json:"password" tf:"sensitive"`
}

// DockerImage contains the image url and the auth for DCS
type DockerImage struct {
URL string `json:"url" tf:"force_new"`
BasicAuth *DockerBasicAuth `json:"basic_auth,omitempty" tf:"force_new"`
URL string `json:"url"`
BasicAuth *DockerBasicAuth `json:"basic_auth,omitempty"`
}

// SortOrder - constants for API
Expand Down
4 changes: 0 additions & 4 deletions clusters/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ func resourceClusterSchema() map[string]*schema.Schema {
return ss
})["library"]

p, err := common.SchemaPath(s, "docker_image", "basic_auth", "password")
if err == nil {
p.Sensitive = true
}
s["autotermination_minutes"].Default = 60
s["cluster_id"] = &schema.Schema{
Type: schema.TypeString,
Expand Down
13 changes: 13 additions & 0 deletions pools/resource_instance_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,19 @@ func ResourceInstancePool() *schema.Resource {
clusters.EbsVolumeTypeThroughputOptimizedHdd,
}, false)
}
if v, err := common.SchemaPath(s, "preloaded_docker_image", "url"); err == nil {
v.ForceNew = true
}
if v, err := common.SchemaPath(s, "preloaded_docker_image", "basic_auth"); err == nil {
v.ForceNew = true
}
if v, err := common.SchemaPath(s, "preloaded_docker_image", "basic_auth", "username"); err == nil {
v.ForceNew = true
}
if v, err := common.SchemaPath(s, "preloaded_docker_image", "basic_auth", "password"); err == nil {
v.ForceNew = true
}

return s
})
return common.Resource{
Expand Down