Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Jul 3, 2024
1 parent b5177ec commit 1973687
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions pkg/tfbridge/internal/schemaconvert/schemaconvert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ func Sdkv2ToV1SchemaOrResource(elem interface{}) interface{} {
}

func Sdkv2ToV1Resource(sch *v2Schema.Resource) *v1Schema.Resource {
//nolint:staticcheck
if sch.MigrateState != nil {
contract.Failf("MigrateState is not supported in conversion")
}
if sch.StateUpgraders != nil {
contract.Failf("StateUpgraders is not supported in conversion")
}
//nolint:staticcheck
if sch.Create != nil || sch.Read != nil || sch.Update != nil || sch.Delete != nil || sch.Exists != nil ||
sch.CreateContext != nil || sch.ReadContext != nil || sch.UpdateContext != nil ||
sch.DeleteContext != nil || sch.Importer != nil {
Expand Down Expand Up @@ -98,20 +100,21 @@ func Sdkv2ToV1Schema(sch *v2Schema.Schema) *v1Schema.Schema {
}

return &v1Schema.Schema{
Type: Sdkv2ToV1Type(sch.Type),
Optional: sch.Optional,
Required: sch.Required,
Default: sch.Default,
DefaultFunc: defaultFunc,
Description: sch.Description,
InputDefault: sch.InputDefault,
Computed: sch.Computed,
ForceNew: sch.ForceNew,
StateFunc: stateFunc,
Elem: Sdkv2ToV1SchemaOrResource(sch.Elem),
MaxItems: sch.MaxItems,
MinItems: sch.MinItems,
Set: set,
Type: Sdkv2ToV1Type(sch.Type),
Optional: sch.Optional,
Required: sch.Required,
Default: sch.Default,
DefaultFunc: defaultFunc,
Description: sch.Description,
InputDefault: sch.InputDefault,
Computed: sch.Computed,
ForceNew: sch.ForceNew,
StateFunc: stateFunc,
Elem: Sdkv2ToV1SchemaOrResource(sch.Elem),
MaxItems: sch.MaxItems,
MinItems: sch.MinItems,
Set: set,
//nolint:staticcheck
ComputedWhen: sch.ComputedWhen,
ConflictsWith: sch.ConflictsWith,
ExactlyOneOf: sch.ExactlyOneOf,
Expand Down

0 comments on commit 1973687

Please sign in to comment.