@@ -110,7 +110,7 @@ func resourceHibernationSchedule() *schema.Resource {
110110 },
111111
112112 Schema : map [string ]* schema.Schema {
113- FieldServiceAccountOrganizationID : {
113+ FieldHibernationScheduleOrganizationID : {
114114 Type : schema .TypeString ,
115115 Optional : true ,
116116 Description : "ID of the organization. If not provided, then will attempt to infer it using CAST AI API client." ,
@@ -422,7 +422,7 @@ func resourceHibernationScheduleUpdate(ctx context.Context, d *schema.ResourceDa
422422
423423 resp , err := client .HibernationSchedulesAPIUpdateHibernationScheduleWithResponse (ctx , organizationID , d .Id (), req )
424424 if checkErr := sdk .CheckOKResponse (resp , err ); checkErr != nil {
425- return diag .FromErr (checkErr )
425+ return diag .FromErr (fmt . Errorf ( "could not update hibernation schedule in organization %s: %v" , organizationID , checkErr ) )
426426 }
427427
428428 return readHibernationScheduleIntoState (ctx , d , meta , organizationID , d .Id ())
@@ -448,17 +448,17 @@ func resourceHibernationScheduleCreate(ctx context.Context, d *schema.ResourceDa
448448
449449 organizationID , err := getHibernationScheduleOrganizationID (ctx , d , meta )
450450 if err != nil {
451- return diag .FromErr (err )
451+ return diag .FromErr (fmt . Errorf ( "could not determine organization id: %v" , err ) )
452452 }
453453
454454 schedule , err := stateToHibernationSchedule (d )
455455 if err != nil {
456- return diag .FromErr (err )
456+ return diag .FromErr (fmt . Errorf ( "could not map state to hibernation schedule: %v" , err ) )
457457 }
458458
459459 resp , err := client .HibernationSchedulesAPICreateHibernationScheduleWithResponse (ctx , organizationID , * schedule )
460460 if checkErr := sdk .CheckOKResponse (resp , err ); checkErr != nil {
461- return diag .FromErr (checkErr )
461+ return diag .FromErr (fmt . Errorf ( "could not create hibernation schedule in organization %s: %v" , organizationID , checkErr ) )
462462 }
463463
464464 d .SetId (* resp .JSON200 .Id )
@@ -478,7 +478,7 @@ func resourceHibernationScheduleRead(ctx context.Context, d *schema.ResourceData
478478func readHibernationScheduleIntoState (ctx context.Context , d * schema.ResourceData , meta any , organizationID , id string ) diag.Diagnostics {
479479 schedule , err := getHibernationScheduleById (ctx , meta , organizationID , id )
480480 if err != nil {
481- return diag .FromErr (err )
481+ return diag .FromErr (fmt . Errorf ( "could not retrieve hibernation schedule by id in organization %s: %v" , organizationID , err ) )
482482 }
483483 if ! d .IsNewResource () && schedule == nil {
484484 tflog .Warn (ctx , "Hibernation schedule not found, removing from state" , map [string ]any {"id" : d .Id ()})
@@ -840,7 +840,7 @@ func sectionToNodeConfig(section map[string]interface{}) cluster_autoscaler.Node
840840 ConfigName : lo .Ternary (configName != "" , & configName , nil ),
841841 SubnetId : lo .Ternary (subnetId != "" , & subnetId , nil ),
842842 Zone : lo .Ternary (zone != "" , & zone , nil ),
843- KubernetesLabels : lo .Ternary (kubernetesLabels != nil && len (kubernetesLabels ) != 0 , & kubernetesLabels , nil ),
843+ KubernetesLabels : lo .Ternary (len (kubernetesLabels ) != 0 , & kubernetesLabels , nil ),
844844 GpuConfig : nodeConfigSectionToGPUConfig (section ),
845845 NodeAffinity : nodeConfigSectionToNodeAffinity (section ),
846846 KubernetesTaints : nodeConfigSectionToKubernetesTaints (section ),
0 commit comments