Skip to content

Commit e622c49

Browse files
committed
address linter findings and remove unused resources
1 parent 211ffd1 commit e622c49

File tree

9 files changed

+18
-23
lines changed

9 files changed

+18
-23
lines changed

infra/gcp/terraform/k8s-infra-gcp-gcve/maintenance-jumphost/jumphost.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ limitations under the License.
1515
*/
1616

1717
variable "project_id" {
18-
description = "The project ID to use for the maintenance jumphost."
18+
description = "The project ID to use for the gcve cluster."
1919
default = "broadcom-451918"
20+
type = string
2021
}
2122

2223
# Read the secret from Secret Manager which contains the wireguard server configuration.
@@ -25,7 +26,7 @@ data "google_secret_manager_secret_version_access" "wireguard-config" {
2526
secret = "maintenance-vm-wireguard-config"
2627
}
2728

28-
# Creates the maintenance jumphost which runs SSH and a wireguard server.
29+
# Create the maintenance jumphost which runs SSH and a wireguard server.
2930
resource "google_compute_instance" "jumphost" {
3031
project = var.project_id
3132
name = "maintenance-jumphost"

infra/gcp/terraform/k8s-infra-gcp-gcve/maintenance-jumphost/provider.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This file defines:
2121
*/
2222

2323
terraform {
24+
required_version = "1.10.5"
2425

2526
backend "gcs" {
2627
bucket = "k8s-infra-tf-gcp-gcve"

infra/gcp/terraform/k8s-infra-gcp-gcve/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ This file defines:
2222

2323
terraform {
2424
required_version = "1.10.5"
25+
2526
backend "gcs" {
2627
bucket = "k8s-infra-tf-gcp-gcve"
2728
prefix = "k8s-infra-gcp-gcve"
2829
}
2930

30-
3131
required_providers {
3232
google = {
3333
source = "hashicorp/google"

infra/gcp/terraform/k8s-infra-gcp-gcve/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ limitations under the License.
1717
variable "project_id" {
1818
description = "The project ID to use for the gcve cluster."
1919
default = "broadcom-451918"
20+
type = string
2021
}

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/data.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,11 @@ data "vsphere_datastore" "datastore" {
3232
datacenter_id = data.vsphere_datacenter.datacenter.id
3333
}
3434

35-
data "vsphere_role" "read-only" {
36-
label = "Read-only"
37-
}
38-
39-
data "vsphere_role" "no-access" {
40-
label = "No access"
41-
}
42-
4335
data "vsphere_network" "network" {
4436
name = var.vsphere_network_name
4537
datacenter_id = data.vsphere_datacenter.datacenter.id
4638
}
4739

48-
data "vsphere_folder" "global" {
49-
path = "/"
50-
}
51-
5240
# Resources from NSX-T.
5341

5442
data "nsxt_policy_tier1_gateway" "tier1_gw" {

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/modules/gcp-gcve-project/provider.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ limitations under the License.
1515
*/
1616

1717
terraform {
18+
required_version = "1.10.5"
19+
1820
required_providers {
1921
vsphere = {
2022
source = "vmware/vsphere"

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/provider.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
/*
18+
This file defines:
19+
- Required provider versions
20+
- Storage backend details
21+
*/
22+
1723
terraform {
24+
required_version = "1.10.5"
1825

1926
backend "gcs" {
2027
bucket = "k8s-infra-tf-gcp-gcve"
2128
prefix = "k8s-infra-gcp-gcve-vcenter"
2229
}
2330

24-
2531
required_providers {
2632
google = {
2733
source = "hashicorp/google"

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/scripts/boskos-userdata.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ function initBoskosResourceUserData() {
4747
boskos_data='{"ipPool":"'"${ipPool}"'","resourcePool":"'"${resourcePool}"'","folder":"'"${folder}"'"}'
4848

4949
# acquire from "dirty" or "free" state
50-
ACQUIRED=1
5150
curl -s -X POST "${BOSKOS_HOST}/acquirebystate?names=${resourceName}&state=dirty&dest=busy&owner=$(whoami)" | grep -q "${resourceName}" \
5251
|| curl -s -X POST "${BOSKOS_HOST}/acquirebystate?names=${resourceName}&state=free&dest=busy&owner=$(whoami)" | grep -q "${resourceName}" \
53-
|| ( echo "Failed to acquire ${resourceName}" ; ACQUIRED=0)
54-
if [[ "${ACQUIRED}" -eq 0 ]]; then
55-
echo "Failed to acquire project ${resourceName}"
56-
fi
52+
|| echo "Failed to acquire ${resourceName}"
5753

5854
# update resource
5955
echo "Updating resource ${resourceName} with following data: ${boskos_data}"

infra/gcp/terraform/k8s-infra-gcp-gcve/vsphere/tags.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ resource "vsphere_tag_category" "category_k8s_zone" {
3939
# Creates the Datacenter tag for the k8s-region tag category for failure domain testing.
4040
resource "vsphere_tag" "tag_k8s_region" {
4141
name = var.vsphere_datacenter
42-
category_id = "${vsphere_tag_category.category_k8s_region.id}"
42+
category_id = vsphere_tag_category.category_k8s_region.id
4343
description = "Managed by Terraform"
4444
}
4545

4646
# Creates the Compute Cluster tag for the k8s-zone tag category for failure domain testing.
4747
resource "vsphere_tag" "tag_k8s_zone" {
4848
name = var.vsphere_cluster
49-
category_id = "${vsphere_tag_category.category_k8s_zone.id}"
49+
category_id = vsphere_tag_category.category_k8s_zone.id
5050
description = "Managed by Terraform"
5151
}

0 commit comments

Comments
 (0)