@@ -492,7 +492,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
492492 return
493493 }
494494 if idx == 0 {
495- tflog .Trace (ctx , "creating template" )
495+ tflog .Info (ctx , "creating template" )
496496 createReq := data .toCreateRequest (ctx , resp , versionResp .ID )
497497 if resp .Diagnostics .HasError () {
498498 return
@@ -502,7 +502,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
502502 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to create template: %s" , err ))
503503 return
504504 }
505- tflog .Trace (ctx , "successfully created template" , map [string ]any {
505+ tflog .Info (ctx , "successfully created template" , map [string ]any {
506506 "id" : templateResp .ID ,
507507 })
508508
@@ -514,7 +514,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
514514 }
515515
516516 if ! data .ACL .IsNull () {
517- tflog .Trace (ctx , "updating template ACL" )
517+ tflog .Info (ctx , "updating template ACL" )
518518 var acl ACL
519519 resp .Diagnostics .Append (
520520 data .ACL .As (ctx , & acl , basetypes.ObjectAsOptions {})... ,
@@ -527,7 +527,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
527527 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to create template ACL: %s" , err ))
528528 return
529529 }
530- tflog .Trace (ctx , "successfully updated template ACL" )
530+ tflog .Info (ctx , "successfully updated template ACL" )
531531 }
532532 }
533533 if version .Active .ValueBool () {
@@ -578,7 +578,7 @@ func (r *TemplateResource) Read(ctx context.Context, req resource.ReadRequest, r
578578 }
579579
580580 if ! data .ACL .IsNull () {
581- tflog .Trace (ctx , "reading template ACL" )
581+ tflog .Info (ctx , "reading template ACL" )
582582 acl , err := client .TemplateACL (ctx , templateID )
583583 if err != nil {
584584 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to get template ACL: %s" , err ))
@@ -591,7 +591,7 @@ func (r *TemplateResource) Read(ctx context.Context, req resource.ReadRequest, r
591591 return
592592 }
593593 data .ACL = aclObj
594- tflog .Trace (ctx , "read template ACL" )
594+ tflog .Info (ctx , "read template ACL" )
595595 }
596596
597597 for idx , version := range data .Versions {
@@ -653,7 +653,7 @@ func (r *TemplateResource) Update(ctx context.Context, req resource.UpdateReques
653653 templateMetadataChanged := ! newState .EqualTemplateMetadata (& curState )
654654 // This is required, as the API will reject no-diff updates.
655655 if templateMetadataChanged {
656- tflog .Trace (ctx , "change in template metadata detected, updating." )
656+ tflog .Info (ctx , "change in template metadata detected, updating." )
657657 updateReq := newState .toUpdateRequest (ctx , resp )
658658 if resp .Diagnostics .HasError () {
659659 return
@@ -664,7 +664,7 @@ func (r *TemplateResource) Update(ctx context.Context, req resource.UpdateReques
664664 return
665665 }
666666
667- tflog .Trace (ctx , "successfully updated template metadata" )
667+ tflog .Info (ctx , "successfully updated template metadata" )
668668 }
669669
670670 // Since the everyone group always gets deleted by `DisableEveryoneGroupAccess`, we need to run this even if there
@@ -680,12 +680,12 @@ func (r *TemplateResource) Update(ctx context.Context, req resource.UpdateReques
680680 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to update template ACL: %s" , err ))
681681 return
682682 }
683- tflog .Trace (ctx , "successfully updated template ACL" )
683+ tflog .Info (ctx , "successfully updated template ACL" )
684684 }
685685
686686 for idx := range newState .Versions {
687687 if newState .Versions [idx ].ID .IsUnknown () {
688- tflog .Trace (ctx , "discovered a new or modified template version" )
688+ tflog .Info (ctx , "discovered a new or modified template version" )
689689 uploadResp , err := newVersion (ctx , client , newVersionRequest {
690690 Version : & newState .Versions [idx ],
691691 OrganizationID : orgID ,
@@ -761,7 +761,7 @@ func (r *TemplateResource) Delete(ctx context.Context, req resource.DeleteReques
761761
762762 templateID := data .ID .ValueUUID ()
763763
764- tflog .Trace (ctx , "deleting template" )
764+ tflog .Info (ctx , "deleting template" )
765765 err := client .DeleteTemplate (ctx , templateID )
766766 if err != nil {
767767 resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to delete template: %s" , err ))
@@ -927,7 +927,7 @@ func waitForJob(ctx context.Context, client *codersdk.Client, version *codersdk.
927927 if ! ok {
928928 break
929929 }
930- tflog .Trace (ctx , logs .Output , map [string ]interface {}{
930+ tflog .Info (ctx , logs .Output , map [string ]interface {}{
931931 "job_id" : logs .ID ,
932932 "job_stage" : logs .Stage ,
933933 "log_source" : logs .Source ,
@@ -959,13 +959,13 @@ type newVersionRequest struct {
959959
960960func newVersion (ctx context.Context , client * codersdk.Client , req newVersionRequest ) (* codersdk.TemplateVersion , error ) {
961961 directory := req .Version .Directory .ValueString ()
962- tflog .Trace (ctx , "uploading directory" )
962+ tflog .Info (ctx , "uploading directory" )
963963 uploadResp , err := uploadDirectory (ctx , client , slog .Make (newTFLogSink (ctx )), directory )
964964 if err != nil {
965965 return nil , fmt .Errorf ("failed to upload directory: %s" , err )
966966 }
967- tflog .Trace (ctx , "successfully uploaded directory" )
968- tflog .Trace (ctx , "discovering and parsing vars files" )
967+ tflog .Info (ctx , "successfully uploaded directory" )
968+ tflog .Info (ctx , "discovering and parsing vars files" )
969969 varFiles , err := codersdk .DiscoverVarsFiles (directory )
970970 if err != nil {
971971 return nil , fmt .Errorf ("failed to discover vars files: %s" , err )
@@ -974,7 +974,7 @@ func newVersion(ctx context.Context, client *codersdk.Client, req newVersionRequ
974974 if err != nil {
975975 return nil , fmt .Errorf ("failed to parse user variable values: %s" , err )
976976 }
977- tflog .Trace (ctx , "discovered and parsed vars files" , map [string ]any {
977+ tflog .Info (ctx , "discovered and parsed vars files" , map [string ]any {
978978 "vars" : vars ,
979979 })
980980 for _ , variable := range req .Version .TerraformVariables {
@@ -994,22 +994,22 @@ func newVersion(ctx context.Context, client *codersdk.Client, req newVersionRequ
994994 if req .TemplateID != nil {
995995 tmplVerReq .TemplateID = * req .TemplateID
996996 }
997- tflog .Trace (ctx , "creating template version" )
997+ tflog .Info (ctx , "creating template version" )
998998 versionResp , err := client .CreateTemplateVersion (ctx , req .OrganizationID , tmplVerReq )
999999 if err != nil {
10001000 return nil , fmt .Errorf ("failed to create template version: %s" , err )
10011001 }
1002- tflog .Trace (ctx , "waiting for template version import job." )
1002+ tflog .Info (ctx , "waiting for template version import job." )
10031003 err = waitForJob (ctx , client , & versionResp )
10041004 if err != nil {
10051005 return nil , fmt .Errorf ("failed to wait for job: %s" , err )
10061006 }
1007- tflog .Trace (ctx , "successfully created template version" )
1007+ tflog .Info (ctx , "successfully created template version" )
10081008 return & versionResp , nil
10091009}
10101010
10111011func markActive (ctx context.Context , client * codersdk.Client , templateID uuid.UUID , versionID uuid.UUID ) error {
1012- tflog .Trace (ctx , "marking template version as active" , map [string ]any {
1012+ tflog .Info (ctx , "marking template version as active" , map [string ]any {
10131013 "version_id" : versionID .String (),
10141014 "template_id" : templateID .String (),
10151015 })
@@ -1019,7 +1019,7 @@ func markActive(ctx context.Context, client *codersdk.Client, templateID uuid.UU
10191019 if err != nil {
10201020 return fmt .Errorf ("Failed to update active template version: %s" , err )
10211021 }
1022- tflog .Trace (ctx , "marked template version as active" )
1022+ tflog .Info (ctx , "marked template version as active" )
10231023 return nil
10241024}
10251025
0 commit comments