Skip to content

Commit da9cc8e

Browse files
Merge pull request #356 from vmware/bangerar/fix-backup-schedule-tests
Fix the backup schedule datasource schema and the broken converter mapping
2 parents 2fa55f4 + 151bcf6 commit da9cc8e

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

internal/resources/cluster/backupschedule/converter_mapping.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,12 @@ var tfModelDataSourceRequestMap = &tfModelConverterHelper.BlockToStruct{
125125
SortByKey: "sortBy",
126126
QueryKey: "query",
127127
IncludeTotalCountKey: "includeTotal",
128-
NameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "name"),
128+
NameKey: tfModelConverterHelper.BuildDefaultModelPath("searchScope", "name"),
129129
ScopeKey: &tfModelConverterHelper.BlockToStruct{
130-
ClusterGroupScopeKey: &tfModelConverterHelper.BlockToStruct{
131-
ClusterGroupNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterGroupName"),
132-
},
133130
ClusterScopeKey: &tfModelConverterHelper.BlockToStruct{
134-
ClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterName"),
135-
ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "managementClusterName"),
136-
ProvisionerNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "provisionerName"),
131+
ClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("searchScope", "clusterName"),
132+
ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("searchScope", "managementClusterName"),
133+
ProvisionerNameKey: tfModelConverterHelper.BuildDefaultModelPath("searchScope", "provisionerName"),
137134
},
138135
},
139136
}

internal/resources/cluster/backupschedule/datasource_schema.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,19 @@ var (
2626
nameDSSchema = &schema.Schema{
2727
Type: schema.TypeString,
2828
Description: "The name of the backup schedule",
29-
Required: true,
30-
ForceNew: true,
29+
Optional: true,
3130
}
3231

3332
managementClusterNameDSSchema = &schema.Schema{
3433
Type: schema.TypeString,
3534
Description: "Management cluster name",
36-
Required: true,
37-
ForceNew: true,
35+
Optional: true,
3836
}
3937

4038
provisionerNameDSSchema = &schema.Schema{
4139
Type: schema.TypeString,
4240
Description: "Cluster provisioner name",
43-
Required: true,
44-
ForceNew: true,
41+
Optional: true,
4542
}
4643

4744
sortBySchema = &schema.Schema{

0 commit comments

Comments
 (0)