@@ -51,19 +51,27 @@ func (r *ResourceMlflowModel) DoCreate(ctx context.Context, config *ml.CreateMod
5151 Name : response .RegisteredModel .Name ,
5252 Description : response .RegisteredModel .Description ,
5353 Tags : response .RegisteredModel .Tags ,
54- ForceSendFields : filterFields [ml.ModelDatabricks ](response .RegisteredModel .ForceSendFields ),
55- // Skip coping fields that are not part of the bundle config tree.
54+ ForceSendFields : filterFields [ml.ModelDatabricks ](response .RegisteredModel .ForceSendFields , "CreationTimestamp" , "Id" , "LastUpdatedTimestamp" , "LatestVersions" , "PermissionLevel" , "UserId" ),
55+
56+ // Coping the fields only to satisfy the linter. These fields are not
57+ // part of the configuration tree so they don't need to be copied.
58+ // The linter works as a safeguard to ensure we add new fields to the bundle config tree
59+ // to the mapping logic here as well.
60+ CreationTimestamp : 0 ,
61+ Id : "" ,
62+ LastUpdatedTimestamp : 0 ,
63+ LatestVersions : nil ,
64+ PermissionLevel : "" ,
65+ UserId : "" ,
5666 }
5767 return response .RegisteredModel .Name , modelDatabricks , nil
5868}
5969
6070func (r * ResourceMlflowModel ) DoUpdate (ctx context.Context , id string , config * ml.CreateModelRequest ) (* ml.ModelDatabricks , error ) {
6171 updateRequest := ml.UpdateModelRequest {
62- Name : id ,
63- Description : config .Description ,
64- // Note: Name changes are not supported by the MLflow model registry API
65- // Tags are updated separately via SetModelTag/DeleteModelTag operations
66- // For simplicity, we only support description updates
72+ Name : id ,
73+ Description : config .Description ,
74+ ForceSendFields : filterFields [ml.UpdateModelRequest ](config .ForceSendFields ),
6775 }
6876
6977 response , err := r .client .ModelRegistry .UpdateModel (ctx , updateRequest )
@@ -77,8 +85,18 @@ func (r *ResourceMlflowModel) DoUpdate(ctx context.Context, id string, config *m
7785 Name : response .RegisteredModel .Name ,
7886 Description : response .RegisteredModel .Description ,
7987 Tags : response .RegisteredModel .Tags ,
80- ForceSendFields : filterFields [ml.ModelDatabricks ](response .RegisteredModel .ForceSendFields ),
81- // Skip coping fields that are not part of the bundle config tree.
88+ ForceSendFields : filterFields [ml.ModelDatabricks ](response .RegisteredModel .ForceSendFields , "CreationTimestamp" , "Id" , "LastUpdatedTimestamp" , "LatestVersions" , "PermissionLevel" , "UserId" ),
89+
90+ // Coping the fields only to satisfy the linter. These fields are not
91+ // part of the configuration tree so they don't need to be copied.
92+ // The linter works as a safeguard to ensure we add new fields to the bundle config tree
93+ // to the mapping logic here as well.
94+ CreationTimestamp : 0 ,
95+ Id : "" ,
96+ LastUpdatedTimestamp : 0 ,
97+ LatestVersions : nil ,
98+ PermissionLevel : "" ,
99+ UserId : "" ,
82100 }
83101 return modelDatabricks , nil
84102}
0 commit comments