@@ -123,62 +123,62 @@ type ClusterSpec struct {
123123 Libraries []compute.Library `json:"libraries,omitempty" tf:"slice_set,alias:library"`
124124}
125125
126- func (ClusterSpec ) CustomizeSchema (s map [ string ] * schema. Schema ) map [ string ] * schema. Schema {
127- common . CustomizeSchemaPath ( s , "cluster_source" ).SetReadOnly ()
128- common . CustomizeSchemaPath ( s , "enable_elastic_disk" ).SetComputed ()
129- common . CustomizeSchemaPath ( s , "enable_local_disk_encryption" ).SetComputed ()
130- common . CustomizeSchemaPath ( s , "node_type_id" ).SetComputed ().SetConflictsWith ([]string {"driver_instance_pool_id" , "instance_pool_id" })
131- common . CustomizeSchemaPath ( s , "driver_node_type_id" ).SetComputed ().SetConflictsWith ([]string {"driver_instance_pool_id" , "instance_pool_id" })
132- common . CustomizeSchemaPath ( s , "driver_instance_pool_id" ).SetComputed ().SetConflictsWith ([]string {"driver_node_type_id" , "node_type_id" })
133- common . CustomizeSchemaPath ( s , "ssh_public_keys" ).SetMaxItems (10 )
134- common . CustomizeSchemaPath ( s , "init_scripts" ).SetMaxItems (10 )
135- common . CustomizeSchemaPath ( s , "init_scripts" , "dbfs" ).SetDeprecated (DbfsDeprecationWarning )
136- common . CustomizeSchemaPath ( s , "init_scripts" , "dbfs" , "destination" ).SetRequired ()
137- common . CustomizeSchemaPath ( s , "init_scripts" , "s3" , "destination" ).SetRequired ()
138- common . CustomizeSchemaPath ( s , "init_scripts" , "volumes" , "destination" ).SetRequired ()
139- common . CustomizeSchemaPath ( s , "init_scripts" , "workspace" , "destination" ).SetRequired ()
140- common . CustomizeSchemaPath ( s , "workload_type" , "clients" ).SetRequired ()
141- common . CustomizeSchemaPath ( s , "workload_type" , "clients" , "notebooks" ).SetDefault (true )
142- common . CustomizeSchemaPath ( s , "workload_type" , "clients" , "jobs" ).SetDefault (true )
143- s [ "library" ] .Set = func (i any ) int {
126+ func (ClusterSpec ) CustomizeSchema (s * common. CustomizableSchema ) * common. CustomizableSchema {
127+ s . SchemaPath ( "cluster_source" ).SetReadOnly ()
128+ s . SchemaPath ( "enable_elastic_disk" ).SetComputed ()
129+ s . SchemaPath ( "enable_local_disk_encryption" ).SetComputed ()
130+ s . SchemaPath ( "node_type_id" ).SetComputed ().SetConflictsWith ([]string {"driver_instance_pool_id" , "instance_pool_id" })
131+ s . SchemaPath ( "driver_node_type_id" ).SetComputed ().SetConflictsWith ([]string {"driver_instance_pool_id" , "instance_pool_id" })
132+ s . SchemaPath ( "driver_instance_pool_id" ).SetComputed ().SetConflictsWith ([]string {"driver_node_type_id" , "node_type_id" })
133+ s . SchemaPath ( "ssh_public_keys" ).SetMaxItems (10 )
134+ s . SchemaPath ( "init_scripts" ).SetMaxItems (10 )
135+ s . SchemaPath ( "init_scripts" , "dbfs" ).SetDeprecated (DbfsDeprecationWarning )
136+ s . SchemaPath ( "init_scripts" , "dbfs" , "destination" ).SetRequired ()
137+ s . SchemaPath ( "init_scripts" , "s3" , "destination" ).SetRequired ()
138+ s . SchemaPath ( "init_scripts" , "volumes" , "destination" ).SetRequired ()
139+ s . SchemaPath ( "init_scripts" , "workspace" , "destination" ).SetRequired ()
140+ s . SchemaPath ( "workload_type" , "clients" ).SetRequired ()
141+ s . SchemaPath ( "workload_type" , "clients" , "notebooks" ).SetDefault (true )
142+ s . SchemaPath ( "workload_type" , "clients" , "jobs" ).SetDefault (true )
143+ s . SchemaPath ( "library" ). Schema .Set = func (i any ) int {
144144 lib := libraries .NewLibraryFromInstanceState (i )
145145 return schema .HashString (lib .String ())
146146 }
147- common . CustomizeSchemaPath ( s ) .AddNewField ("idempotency_token" , & schema.Schema {
147+ s .AddNewField ("idempotency_token" , & schema.Schema {
148148 Type : schema .TypeString ,
149149 Optional : true ,
150150 ForceNew : true ,
151151 })
152- common . CustomizeSchemaPath ( s , "data_security_mode" ).SetSuppressDiff ()
153- common . CustomizeSchemaPath ( s , "docker_image" , "url" ).SetRequired ()
154- common . CustomizeSchemaPath ( s , "docker_image" , "basic_auth" , "password" ).SetRequired ().SetSensitive ()
155- common . CustomizeSchemaPath ( s , "docker_image" , "basic_auth" , "username" ).SetRequired ()
156- common . CustomizeSchemaPath ( s , "spark_conf" ).SetCustomSuppressDiff (SparkConfDiffSuppressFunc )
157- common . CustomizeSchemaPath ( s , "aws_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"azure_attributes" , "gcp_attributes" })
158- common . CustomizeSchemaPath ( s , "aws_attributes" , "zone_id" ).SetCustomSuppressDiff (ZoneDiffSuppress )
159- common . CustomizeSchemaPath ( s , "azure_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"aws_attributes" , "gcp_attributes" })
160- common . CustomizeSchemaPath ( s , "gcp_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"aws_attributes" , "azure_attributes" })
161- common . CustomizeSchemaPath ( s , "autotermination_minutes" ).SetDefault (60 )
162- common . CustomizeSchemaPath ( s , "autoscale" , "max_workers" ).SetOptional ()
163- common . CustomizeSchemaPath ( s , "autoscale" , "min_workers" ).SetOptional ()
164- common . CustomizeSchemaPath ( s , "cluster_log_conf" , "dbfs" , "destination" ).SetRequired ()
165- common . CustomizeSchemaPath ( s , "cluster_log_conf" , "s3" , "destination" ).SetRequired ()
166- common . CustomizeSchemaPath ( s , "spark_version" ).SetRequired ()
167- common . CustomizeSchemaPath ( s ) .AddNewField ("cluster_id" , & schema.Schema {
152+ s . SchemaPath ( "data_security_mode" ).SetSuppressDiff ()
153+ s . SchemaPath ( "docker_image" , "url" ).SetRequired ()
154+ s . SchemaPath ( "docker_image" , "basic_auth" , "password" ).SetRequired ().SetSensitive ()
155+ s . SchemaPath ( "docker_image" , "basic_auth" , "username" ).SetRequired ()
156+ s . SchemaPath ( "spark_conf" ).SetCustomSuppressDiff (SparkConfDiffSuppressFunc )
157+ s . SchemaPath ( "aws_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"azure_attributes" , "gcp_attributes" })
158+ s . SchemaPath ( "aws_attributes" , "zone_id" ).SetCustomSuppressDiff (ZoneDiffSuppress )
159+ s . SchemaPath ( "azure_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"aws_attributes" , "gcp_attributes" })
160+ s . SchemaPath ( "gcp_attributes" ).SetSuppressDiff ().SetConflictsWith ([]string {"aws_attributes" , "azure_attributes" })
161+ s . SchemaPath ( "autotermination_minutes" ).SetDefault (60 )
162+ s . SchemaPath ( "autoscale" , "max_workers" ).SetOptional ()
163+ s . SchemaPath ( "autoscale" , "min_workers" ).SetOptional ()
164+ s . SchemaPath ( "cluster_log_conf" , "dbfs" , "destination" ).SetRequired ()
165+ s . SchemaPath ( "cluster_log_conf" , "s3" , "destination" ).SetRequired ()
166+ s . SchemaPath ( "spark_version" ).SetRequired ()
167+ s .AddNewField ("cluster_id" , & schema.Schema {
168168 Type : schema .TypeString ,
169169 Computed : true ,
170170 })
171- common . CustomizeSchemaPath ( s ) .AddNewField ("default_tags" , & schema.Schema {
171+ s .AddNewField ("default_tags" , & schema.Schema {
172172 Type : schema .TypeMap ,
173173 Computed : true ,
174174 })
175- common . CustomizeSchemaPath ( s ) .AddNewField ("state" , & schema.Schema {
175+ s .AddNewField ("state" , & schema.Schema {
176176 Type : schema .TypeString ,
177177 Computed : true ,
178178 })
179- common . CustomizeSchemaPath ( s , "instance_pool_id" ).SetConflictsWith ([]string {"driver_node_type_id" , "node_type_id" })
180- common . CustomizeSchemaPath ( s , "runtime_engine" ).SetValidateFunc (validation .StringInSlice ([]string {"PHOTON" , "STANDARD" }, false ))
181- common . CustomizeSchemaPath ( s ) .AddNewField ("is_pinned" , & schema.Schema {
179+ s . SchemaPath ( "instance_pool_id" ).SetConflictsWith ([]string {"driver_node_type_id" , "node_type_id" })
180+ s . SchemaPath ( "runtime_engine" ).SetValidateFunc (validation .StringInSlice ([]string {"PHOTON" , "STANDARD" }, false ))
181+ s .AddNewField ("is_pinned" , & schema.Schema {
182182 Type : schema .TypeBool ,
183183 Optional : true ,
184184 Default : false ,
@@ -189,12 +189,12 @@ func (ClusterSpec) CustomizeSchema(s map[string]*schema.Schema) map[string]*sche
189189 return old == new
190190 },
191191 })
192- common . CustomizeSchemaPath ( s ) .AddNewField ("url" , & schema.Schema {
192+ s .AddNewField ("url" , & schema.Schema {
193193 Type : schema .TypeString ,
194194 Computed : true ,
195195 })
196- common . CustomizeSchemaPath ( s , "num_workers" ).SetDefault (0 ).SetValidateDiagFunc (validation .ToDiagFunc (validation .IntAtLeast (0 )))
197- common . CustomizeSchemaPath ( s ) .AddNewField ("cluster_mount_info" , & schema.Schema {
196+ s . SchemaPath ( "num_workers" ).SetDefault (0 ).SetValidateDiagFunc (validation .ToDiagFunc (validation .IntAtLeast (0 )))
197+ s .AddNewField ("cluster_mount_info" , & schema.Schema {
198198 Type : schema .TypeList ,
199199 Optional : true ,
200200 Elem : & schema.Resource {
0 commit comments