From 17ce9eba644ab7aff9a6f26e6f493bc6b1601fa4 Mon Sep 17 00:00:00 2001 From: Shobha M Date: Thu, 30 Nov 2023 16:38:22 +0530 Subject: [PATCH] Fix data protection schema and documentation Signed-off-by: Shobha M --- docs/data-sources/backup_schedule.md | 6 +++--- docs/resources/backup_schedule.md | 17 ++++------------- docs/resources/enable_data_protection.md | 9 --------- docs/resources/target_location.md | 12 ++++++------ .../cluster/backupschedule/converter_mapping.go | 3 --- .../cluster/backupschedule/datasource_schema.go | 16 ---------------- .../cluster/backupschedule/resource_schema.go | 16 ---------------- .../cluster/dataprotection/converter_mapping.go | 3 --- .../resources/cluster/dataprotection/schema.go | 16 ---------------- .../resources/package/data_source_package.go | 2 +- 10 files changed, 14 insertions(+), 86 deletions(-) diff --git a/docs/data-sources/backup_schedule.md b/docs/data-sources/backup_schedule.md index 6314ba832..c0b0b510c 100644 --- a/docs/data-sources/backup_schedule.md +++ b/docs/data-sources/backup_schedule.md @@ -33,13 +33,13 @@ data "tanzu-mission-control_backup_schedule" "demo" { ### Required -- `scope` (Block List, Min: 1, Max: 1) Search scope block (see [below for nested schema](#nestedblock--scope)) - `name` (String) The name of the backup schedule +- `scope` (Block List, Min: 1, Max: 1) Search scope block (see [below for nested schema](#nestedblock--scope)) ### Optional - `include_total_count` (Boolean) Whether to include total count of backups. - (Default: True) +(Default: True) - `query` (String) Define a query for listing backups - `sort_by` (String) Sort backups by field. @@ -72,9 +72,9 @@ Required: Read-Only: -- `name` (String) - `backup_scope` (String) - `meta` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--meta)) +- `name` (String) - `scope` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope)) - `spec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec)) diff --git a/docs/resources/backup_schedule.md b/docs/resources/backup_schedule.md index b51cd3f9c..75cdc7e12 100644 --- a/docs/resources/backup_schedule.md +++ b/docs/resources/backup_schedule.md @@ -40,7 +40,7 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" { } template { - backup_ttl = "2592000s" + backup_ttl = "2592000s" excluded_namespaces = [ "app-01", "app-02", @@ -169,9 +169,9 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" { template { default_volumes_to_fs_backup = false - include_cluster_resources = true - backup_ttl = "604800s" - storage_location = "TARGET_LOCATION_NAME" + include_cluster_resources = true + backup_ttl = "604800s" + storage_location = "TARGET_LOCATION_NAME" label_selector { match_expression { @@ -221,7 +221,6 @@ Valid values are (FULL_CLUSTER, SET_NAMESPACES, LABEL_SELECTOR) Optional: - `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster)) -- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group)) ### Nested Schema for `scope.cluster` @@ -233,14 +232,6 @@ Required: - `provisioner_name` (String) Cluster provisioner name - -### Nested Schema for `scope.cluster_group` - -Required: - -- `cluster_group_name` (String) Cluster group name - - ### Nested Schema for `spec` diff --git a/docs/resources/enable_data_protection.md b/docs/resources/enable_data_protection.md index 9af5537c4..e02d27a54 100644 --- a/docs/resources/enable_data_protection.md +++ b/docs/resources/enable_data_protection.md @@ -67,7 +67,6 @@ terraform import tanzu-mission-control_backup_schedule.demo_backup MANAGEMENT_CL Optional: - `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster)) -- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group)) ### Nested Schema for `scope.cluster` @@ -79,14 +78,6 @@ Required: - `provisioner_name` (String) Cluster provisioner name - -### Nested Schema for `scope.cluster_group` - -Required: - -- `cluster_group_name` (String) Cluster group name - - ### Nested Schema for `deletion_policy` diff --git a/docs/resources/target_location.md b/docs/resources/target_location.md index 9184fda1d..9d51b79fe 100644 --- a/docs/resources/target_location.md +++ b/docs/resources/target_location.md @@ -22,11 +22,11 @@ For more information regarding target location, see [Target Location][target-loc ```terraform resource "tanzu-mission-control_target_location" "demo_tmc_managed" { - name = "TARGET_LOCATION_NAME" + name = "TARGET_LOCATION_NAME" spec { target_provider = "TARGET_PROVIDER_NAME" - credential = { + credential = { name = "CREDENTIAL_NAME" } @@ -58,11 +58,11 @@ resource "tanzu-mission-control_target_location" "demo_tmc_managed" { ```terraform resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" { - name = "TARGET_LOCATION_NAME" + name = "TARGET_LOCATION_NAME" spec { target_provider = "AWS" - credential = { + credential = { name = "AWS_CREDENTIAL_NAME" } @@ -102,11 +102,11 @@ resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" { ```terraform resource "tanzu-mission-control_target_location" "demo_aws_self_provisioned" { - name = "TARGET_LOCATION_NAME" + name = "TARGET_LOCATION_NAME" spec { target_provider = "AWS" - credential = { + credential = { name = "AWS_CREDENTIAL_NAME" } diff --git a/internal/resources/cluster/backupschedule/converter_mapping.go b/internal/resources/cluster/backupschedule/converter_mapping.go index 86c654f54..9f0955ea6 100644 --- a/internal/resources/cluster/backupschedule/converter_mapping.go +++ b/internal/resources/cluster/backupschedule/converter_mapping.go @@ -22,9 +22,6 @@ var ( var tfModelResourceMap = &tfModelConverterHelper.BlockToStruct{ NameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "name"), ScopeKey: &tfModelConverterHelper.BlockToStruct{ - ClusterGroupScopeKey: &tfModelConverterHelper.BlockToStruct{ - ClusterGroupNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterGroupName"), - }, ClusterScopeKey: &tfModelConverterHelper.BlockToStruct{ ClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterName"), ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "managementClusterName"), diff --git a/internal/resources/cluster/backupschedule/datasource_schema.go b/internal/resources/cluster/backupschedule/datasource_schema.go index eee54c873..4b4ed5bfb 100644 --- a/internal/resources/cluster/backupschedule/datasource_schema.go +++ b/internal/resources/cluster/backupschedule/datasource_schema.go @@ -96,22 +96,6 @@ var searchScopeSchema = &schema.Schema{ Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - ClusterGroupScopeKey: { - Type: schema.TypeList, - Optional: true, - Description: "Cluster group scope block", - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - ClusterGroupNameKey: { - Type: schema.TypeString, - Description: "Cluster group name", - Required: true, - ForceNew: true, - }, - }, - }, - }, ClusterScopeKey: { Type: schema.TypeList, Optional: true, diff --git a/internal/resources/cluster/backupschedule/resource_schema.go b/internal/resources/cluster/backupschedule/resource_schema.go index 41e47d409..b64cfd08c 100644 --- a/internal/resources/cluster/backupschedule/resource_schema.go +++ b/internal/resources/cluster/backupschedule/resource_schema.go @@ -104,22 +104,6 @@ var scopeSchema = &schema.Schema{ Optional: false, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - ClusterGroupScopeKey: { - Type: schema.TypeList, - Optional: true, - Description: "Cluster group scope block", - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - ClusterGroupNameKey: { - Type: schema.TypeString, - Description: "Cluster group name", - Required: true, - ForceNew: true, - }, - }, - }, - }, ClusterScopeKey: { Type: schema.TypeList, Optional: true, diff --git a/internal/resources/cluster/dataprotection/converter_mapping.go b/internal/resources/cluster/dataprotection/converter_mapping.go index 227ca223a..bd0837a3b 100644 --- a/internal/resources/cluster/dataprotection/converter_mapping.go +++ b/internal/resources/cluster/dataprotection/converter_mapping.go @@ -18,9 +18,6 @@ var tfModelMap = &tfModelConverterHelper.BlockToStruct{ ManagementClusterNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "managementClusterName"), ProvisionerNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "provisionerName"), }, - ClusterGroupScopeKey: &tfModelConverterHelper.BlockToStruct{ - ClusterGroupNameKey: tfModelConverterHelper.BuildDefaultModelPath("fullName", "clusterGroupName"), - }, }, common.MetaKey: common.GetMetaConverterMap(tfModelConverterHelper.DefaultModelPathSeparator), SpecKey: &tfModelConverterHelper.BlockToStruct{ diff --git a/internal/resources/cluster/dataprotection/schema.go b/internal/resources/cluster/dataprotection/schema.go index d16df3fe3..1fdedea38 100644 --- a/internal/resources/cluster/dataprotection/schema.go +++ b/internal/resources/cluster/dataprotection/schema.go @@ -49,22 +49,6 @@ var scopeSchema = &schema.Schema{ Optional: false, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - ClusterGroupScopeKey: { - Type: schema.TypeList, - Optional: true, - Description: "Cluster group scope block", - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - ClusterGroupNameKey: { - Type: schema.TypeString, - Description: "Cluster group name", - Required: true, - ForceNew: true, - }, - }, - }, - }, ClusterScopeKey: { Type: schema.TypeList, Optional: true, diff --git a/internal/resources/package/data_source_package.go b/internal/resources/package/data_source_package.go index 5cdfdee34..38df54799 100644 --- a/internal/resources/package/data_source_package.go +++ b/internal/resources/package/data_source_package.go @@ -40,7 +40,7 @@ var packageSchema = map[string]*schema.Schema{ }, namespaceKey: { Type: schema.TypeString, - Description: "Namespae of package.", + Description: "Namespace of package.", Computed: true, }, metadataNameKey: {