Skip to content

Commit 26f2022

Browse files
committed
customDiff function with forceNew on name
1 parent 137ea37 commit 26f2022

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/services/baremetal/helpers.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,12 @@ func customDiffOffer() func(ctx context.Context, diff *schema.ResourceDiff, i in
219219
return err
220220
}
221221
if oldOfferDetails.Name != newOfferDetails.Name {
222-
//TODO error
222+
return diff.ForceNew("offer changed")
223223
}
224224
if oldOfferDetails.SubscriptionPeriod == baremetal.OfferSubscriptionPeriodMonthly && newOfferDetails.SubscriptionPeriod == baremetal.OfferSubscriptionPeriodHourly {
225-
//TODO error
225+
return errors.New("Offer's subscription period is restricted to monthly or hourly")
226226
}
227-
//TODO manage the migration
228227
return nil
229-
230228
}
231229
}
232230

0 commit comments

Comments
 (0)