Skip to content

Commit e8df664

Browse files
committed
Fix test and lint issues
Signed-off-by: Ishan Gupta <gishan@vmware.com>
1 parent cb25cfb commit e8df664

15 files changed

+51
-47
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
data "tanzu-mission-control_inspections" "demo" {
2-
management_cluster_name = "MGMT_CLS_NAME"
3-
provisioner_name = "PROVISIONER_NAME"
4-
cluster_name = "CLS_NAME"
5-
}
1+
data "tanzu-mission-control_inspections" "demo" {
2+
management_cluster_name = "MGMT_CLS_NAME"
3+
provisioner_name = "PROVISIONER_NAME"
4+
cluster_name = "CLS_NAME"
5+
}
66

7-
output "inspections" {
8-
value = data.tanzu-mission-control_inspections.demo.inspections
9-
}
7+
output "inspections" {
8+
value = data.tanzu-mission-control_inspections.demo.inspections
9+
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Read Tanzu Mission Control management cluster registration : fetch management cluster registration details
22
data "tanzu-mission-control_management_cluster" "read_management_cluster_registration" {
3-
name = "default" # Required
3+
name = "default" # Required
44
org_id = "<ID of Organization>" # Optional value
55
}

examples/data-sources/provisioner/data_source_provisioner.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Read Tanzu Mission Control provisioner : fetch the given provisioner details
22
data "tanzu-mission-control_provisioner" "read_provisioner" {
33
provisioners {
4-
name = "test-provisioner" # Optional
5-
management_cluster = "eks" # Required
4+
name = "test-provisioner" # Optional
5+
management_cluster = "eks" # Required
66
}
77
}
88

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "tanzu-mission-control_enable_data_protection" "cgdemo" {
22
scope {
33
cluster_group {
4-
cluster_group_name = "default"
4+
cluster_group_name = "default"
55
}
66
}
77

@@ -11,21 +11,21 @@ resource "tanzu-mission-control_enable_data_protection" "cgdemo" {
1111
enable_all_api_group_versions_backup = false
1212

1313
selector {
14-
labelselector {
15-
matchexpressions {
16-
key = "site"
17-
operator = "NotIn"
18-
values = [
19-
"one",
20-
"two"
21-
]
22-
}
14+
labelselector {
15+
matchexpressions {
16+
key = "site"
17+
operator = "NotIn"
18+
values = [
19+
"one",
20+
"two"
21+
]
2322
}
23+
}
2424
}
2525
}
2626

2727
deletion_policy {
2828
delete_backups = false
29-
force = true
29+
force = true
3030
}
3131
}

examples/resources/ekscluster/cluster.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ resource "tanzu-mission-control_ekscluster" "tf_eks_cluster" {
5454
vpc_cni_config {
5555
eni_config {
5656
id = "subnet-0a680171b6330619f" // Required, need not belong to the same VPC as the cluster, subnets provided in vpc_cni_config are expected to be in different AZs
57-
security_groups = [ //optional, if not provided, the cluster security group will be used
57+
security_groups = [ //optional, if not provided, the cluster security group will be used
5858
"sg-00c96ad9d02a22522",
5959
]
6060
}

examples/resources/management_cluster/resource_management_cluster_registration_minimal_tkgm.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
5+
cluster_group = "default" // Required
66
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID" // Required
77
}
88
}

examples/resources/management_cluster/resource_management_cluster_registration_minimal_tkgs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
5+
cluster_group = "default" // Required
66
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID_SERVICE" // Required
77
}
88
}

examples/resources/management_cluster/resource_management_cluster_registration_tkgm.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
6-
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID" // Required
7-
image_registry = "image_registry_value" // Optional - only allowed with TKGm - if supplied this should be the name of a pre configured local image registry configured in TMC to pull images from
8-
managed_workload_cluster_image_registry = "workload_cluster_image_registry_value" // Optional - only allowed with TKGm - only allowed if image_registry is not empty
9-
management_proxy_name = "proxy_name_value" // Optional - name of proxy configuration to use which is already configured in TMC
10-
managed_workload_cluster_proxy_name = "workload_cluster_proxy_name_value" // Optional - only allowed if proxy_name is not empty
5+
cluster_group = "default" // Required
6+
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID" // Required
7+
image_registry = "image_registry_value" // Optional - only allowed with TKGm - if supplied this should be the name of a pre configured local image registry configured in TMC to pull images from
8+
managed_workload_cluster_image_registry = "workload_cluster_image_registry_value" // Optional - only allowed with TKGm - only allowed if image_registry is not empty
9+
management_proxy_name = "proxy_name_value" // Optional - name of proxy configuration to use which is already configured in TMC
10+
managed_workload_cluster_proxy_name = "workload_cluster_proxy_name_value" // Optional - only allowed if proxy_name is not empty
1111
}
1212
}

examples/resources/management_cluster/resource_management_cluster_registration_tkgs.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
5+
cluster_group = "default" // Required
66
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID_SERVICE" // Required
7-
management_proxy_name = "proxy_name_value" // Optional - name of proxy configuration to use which is already configured in TMC
8-
managed_workload_cluster_proxy_name = "workload_cluster_proxy_name_value" // Optional - only allowed if proxy_name is not empty
7+
management_proxy_name = "proxy_name_value" // Optional - name of proxy configuration to use which is already configured in TMC
8+
managed_workload_cluster_proxy_name = "workload_cluster_proxy_name_value" // Optional - only allowed if proxy_name is not empty
99
}
1010
}

examples/resources/management_cluster/resource_management_cluster_registration_with_kubeconfig_file_path.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
5+
cluster_group = "default" // Required
66
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID" // Required
77
}
88

99
register_management_cluster {
10-
tkgm_kubeconfig_file = "<kube-config-path>" // Required
11-
tkgm_description = "optional description about the kube-config provided" // Optional
10+
tkgm_kubeconfig_file = "<kube-config-path>" // Required
11+
tkgm_description = "optional description about the kube-config provided" // Optional
1212
}
1313

1414
ready_wait_timeout = "15m" // Optional , default value is 15m

examples/resources/management_cluster/resource_management_cluster_registration_with_kubeconfig_raw_input.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ resource "tanzu-mission-control_management_cluster" "management_cluster_registra
22
name = "tf-registration-test" // Required
33

44
spec {
5-
cluster_group = "default" // Required
5+
cluster_group = "default" // Required
66
kubernetes_provider_type = "VMWARE_TANZU_KUBERNETES_GRID" // Required
77
}
88

99
register_management_cluster {
10-
tkgm_kubeconfig_raw = var.kubeconfig // Required
10+
tkgm_kubeconfig_raw = var.kubeconfig // Required
1111
tkgm_description = "optional description about the kube-config provided" // Optional
1212
}
1313

examples/resources/provisioner/provisioner_resource.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Create provisioner resource
22
resource "tanzu-mission-control_provisioner" "create_provisioner" {
3-
name = "demo-test" # Required
4-
management_cluster = "eks" # Required
3+
name = "demo-test" # Required
4+
management_cluster = "eks" # Required
55

66
meta {
77
description = "Create provisioner through terraform"

examples/usecases/custom_policy_with_custom_template_usecase.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ resource "tanzu-mission-control_custom_policy" "cluster_group_scoped_custom_temp
104104
input {
105105
custom {
106106
template_name = tanzu-mission-control_custom_policy_template.sample_template.name
107-
audit = false
107+
audit = false
108108

109109
target_kubernetes_resources {
110110
api_groups = [

internal/resources/tanzupackageinstall/spec/spec_flatten_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ func TestFlattenSpecForClusterScope(t *testing.T) {
5959
"namespace": "cert-manager",
6060
"some": "91",
6161
},
62+
PathToInlineValuesKey: map[string]interface{}{
63+
"namespace": "cert-manager",
64+
"some": 91,
65+
},
6266
},
6367
},
6468
},

resource_templates/data_protection_feature.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Tanzu Mission Control Data Protection Feature
22

33
locals {
4-
cluster_name = "<cluster-name>"
4+
cluster_name = "<cluster-name>"
55
management_cluster_name = "<management-cluster-name>"
66
provisioner_name = "<provisioner-name>"
77
}
@@ -30,11 +30,11 @@ resource "tanzu-mission-control_enable_data_protection" "data_protection" {
3030
// Create Target Location for Scheduled Back Up
3131
// Self managed AWS Target Location
3232
resource "tanzu-mission-control_target_location" "aws_self_provisioned" {
33-
name = "<target-location-name>"
33+
name = "<target-location-name>"
3434

3535
spec {
3636
target_provider = "AWS"
37-
credential = {
37+
credential = {
3838
name = "<aws-credential-name?"
3939
}
4040

@@ -63,7 +63,7 @@ resource "tanzu-mission-control_target_location" "aws_self_provisioned" {
6363

6464
// Create Full Cluster Scheduled Back Up
6565
resource "tanzu-mission-control_backup_schedule" "backup_full_cluster" {
66-
name = "<scheduled-backup-name>"
66+
name = "<scheduled-backup-name>"
6767
scope {
6868
cluster {
6969
cluster_name = local.cluster_name
@@ -80,7 +80,7 @@ resource "tanzu-mission-control_backup_schedule" "backup_full_cluster" {
8080
}
8181

8282
template {
83-
backup_ttl = "2592000s"
83+
backup_ttl = "2592000s"
8484
excluded_namespaces = [
8585
"<namespace-1>",
8686
]

0 commit comments

Comments
 (0)