@@ -492,7 +492,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
492
492
return
493
493
}
494
494
if idx == 0 {
495
- tflog .Trace (ctx , "creating template" )
495
+ tflog .Info (ctx , "creating template" )
496
496
createReq := data .toCreateRequest (ctx , resp , versionResp .ID )
497
497
if resp .Diagnostics .HasError () {
498
498
return
@@ -502,7 +502,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
502
502
resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to create template: %s" , err ))
503
503
return
504
504
}
505
- tflog .Trace (ctx , "successfully created template" , map [string ]any {
505
+ tflog .Info (ctx , "successfully created template" , map [string ]any {
506
506
"id" : templateResp .ID ,
507
507
})
508
508
@@ -514,7 +514,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
514
514
}
515
515
516
516
if ! data .ACL .IsNull () {
517
- tflog .Trace (ctx , "updating template ACL" )
517
+ tflog .Info (ctx , "updating template ACL" )
518
518
var acl ACL
519
519
resp .Diagnostics .Append (
520
520
data .ACL .As (ctx , & acl , basetypes.ObjectAsOptions {})... ,
@@ -527,7 +527,7 @@ func (r *TemplateResource) Create(ctx context.Context, req resource.CreateReques
527
527
resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to create template ACL: %s" , err ))
528
528
return
529
529
}
530
- tflog .Trace (ctx , "successfully updated template ACL" )
530
+ tflog .Info (ctx , "successfully updated template ACL" )
531
531
}
532
532
}
533
533
if version .Active .ValueBool () {
@@ -578,7 +578,7 @@ func (r *TemplateResource) Read(ctx context.Context, req resource.ReadRequest, r
578
578
}
579
579
580
580
if ! data .ACL .IsNull () {
581
- tflog .Trace (ctx , "reading template ACL" )
581
+ tflog .Info (ctx , "reading template ACL" )
582
582
acl , err := client .TemplateACL (ctx , templateID )
583
583
if err != nil {
584
584
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
591
591
return
592
592
}
593
593
data .ACL = aclObj
594
- tflog .Trace (ctx , "read template ACL" )
594
+ tflog .Info (ctx , "read template ACL" )
595
595
}
596
596
597
597
for idx , version := range data .Versions {
@@ -653,7 +653,7 @@ func (r *TemplateResource) Update(ctx context.Context, req resource.UpdateReques
653
653
templateMetadataChanged := ! newState .EqualTemplateMetadata (& curState )
654
654
// This is required, as the API will reject no-diff updates.
655
655
if templateMetadataChanged {
656
- tflog .Trace (ctx , "change in template metadata detected, updating." )
656
+ tflog .Info (ctx , "change in template metadata detected, updating." )
657
657
updateReq := newState .toUpdateRequest (ctx , resp )
658
658
if resp .Diagnostics .HasError () {
659
659
return
@@ -664,7 +664,7 @@ func (r *TemplateResource) Update(ctx context.Context, req resource.UpdateReques
664
664
return
665
665
}
666
666
667
- tflog .Trace (ctx , "successfully updated template metadata" )
667
+ tflog .Info (ctx , "successfully updated template metadata" )
668
668
}
669
669
670
670
// 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
680
680
resp .Diagnostics .AddError ("Client Error" , fmt .Sprintf ("Failed to update template ACL: %s" , err ))
681
681
return
682
682
}
683
- tflog .Trace (ctx , "successfully updated template ACL" )
683
+ tflog .Info (ctx , "successfully updated template ACL" )
684
684
}
685
685
686
686
for idx := range newState .Versions {
687
687
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" )
689
689
uploadResp , err := newVersion (ctx , client , newVersionRequest {
690
690
Version : & newState .Versions [idx ],
691
691
OrganizationID : orgID ,
@@ -761,7 +761,7 @@ func (r *TemplateResource) Delete(ctx context.Context, req resource.DeleteReques
761
761
762
762
templateID := data .ID .ValueUUID ()
763
763
764
- tflog .Trace (ctx , "deleting template" )
764
+ tflog .Info (ctx , "deleting template" )
765
765
err := client .DeleteTemplate (ctx , templateID )
766
766
if err != nil {
767
767
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.
927
927
if ! ok {
928
928
break
929
929
}
930
- tflog .Trace (ctx , logs .Output , map [string ]interface {}{
930
+ tflog .Info (ctx , logs .Output , map [string ]interface {}{
931
931
"job_id" : logs .ID ,
932
932
"job_stage" : logs .Stage ,
933
933
"log_source" : logs .Source ,
@@ -959,13 +959,13 @@ type newVersionRequest struct {
959
959
960
960
func newVersion (ctx context.Context , client * codersdk.Client , req newVersionRequest ) (* codersdk.TemplateVersion , error ) {
961
961
directory := req .Version .Directory .ValueString ()
962
- tflog .Trace (ctx , "uploading directory" )
962
+ tflog .Info (ctx , "uploading directory" )
963
963
uploadResp , err := uploadDirectory (ctx , client , slog .Make (newTFLogSink (ctx )), directory )
964
964
if err != nil {
965
965
return nil , fmt .Errorf ("failed to upload directory: %s" , err )
966
966
}
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" )
969
969
varFiles , err := codersdk .DiscoverVarsFiles (directory )
970
970
if err != nil {
971
971
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
974
974
if err != nil {
975
975
return nil , fmt .Errorf ("failed to parse user variable values: %s" , err )
976
976
}
977
- tflog .Trace (ctx , "discovered and parsed vars files" , map [string ]any {
977
+ tflog .Info (ctx , "discovered and parsed vars files" , map [string ]any {
978
978
"vars" : vars ,
979
979
})
980
980
for _ , variable := range req .Version .TerraformVariables {
@@ -994,22 +994,22 @@ func newVersion(ctx context.Context, client *codersdk.Client, req newVersionRequ
994
994
if req .TemplateID != nil {
995
995
tmplVerReq .TemplateID = * req .TemplateID
996
996
}
997
- tflog .Trace (ctx , "creating template version" )
997
+ tflog .Info (ctx , "creating template version" )
998
998
versionResp , err := client .CreateTemplateVersion (ctx , req .OrganizationID , tmplVerReq )
999
999
if err != nil {
1000
1000
return nil , fmt .Errorf ("failed to create template version: %s" , err )
1001
1001
}
1002
- tflog .Trace (ctx , "waiting for template version import job." )
1002
+ tflog .Info (ctx , "waiting for template version import job." )
1003
1003
err = waitForJob (ctx , client , & versionResp )
1004
1004
if err != nil {
1005
1005
return nil , fmt .Errorf ("failed to wait for job: %s" , err )
1006
1006
}
1007
- tflog .Trace (ctx , "successfully created template version" )
1007
+ tflog .Info (ctx , "successfully created template version" )
1008
1008
return & versionResp , nil
1009
1009
}
1010
1010
1011
1011
func 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 {
1013
1013
"version_id" : versionID .String (),
1014
1014
"template_id" : templateID .String (),
1015
1015
})
@@ -1019,7 +1019,7 @@ func markActive(ctx context.Context, client *codersdk.Client, templateID uuid.UU
1019
1019
if err != nil {
1020
1020
return fmt .Errorf ("Failed to update active template version: %s" , err )
1021
1021
}
1022
- tflog .Trace (ctx , "marked template version as active" )
1022
+ tflog .Info (ctx , "marked template version as active" )
1023
1023
return nil
1024
1024
}
1025
1025
0 commit comments