Skip to content

Commit 69b9f34

Browse files
committed
lint fixes
1 parent 2646fa0 commit 69b9f34

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

helpers/foundation-deployer/gcp/gcp.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func NewGCP() GCP {
4949

5050
// IsComponentInstalled checks if a given gcloud component is installed
5151
func (g GCP) IsComponentInstalled(t testing.TB, componentID string) bool {
52-
filter := fmt.Sprintf("\"id='%s'\"",componentID)
53-
components := g.Runf(t, "components list --filter %s", filter).Array()
52+
filter := fmt.Sprintf("\"id='%s'\"", componentID)
53+
components := g.Runf(t, "components list --filter %s", filter).Array()
5454
if len(components) == 0 {
5555
return false
5656
}
@@ -158,12 +158,12 @@ func (g GCP) HasTagKey(t testing.TB, orgID, tag string) bool {
158158
}
159159

160160
// EnableApis enables the apis in the given project
161-
func (g GCP) EnableApis(t testing.TB, project string, apis []string) {
161+
func (g GCP) EnableAPIs(t testing.TB, project string, apis []string) {
162162
g.Runf(t, "services enable %s --project %s", strings.Join(apis, " "), project)
163163
}
164164

165-
// IsApiEnabled checks if the api is enabled in the given project
166-
func (g GCP) IsApiEnabled(t testing.TB, project, api string) bool {
165+
// IsAPIEnabled checks if the api is enabled in the given project
166+
func (g GCP) IsAPIEnabled(t testing.TB, project, api string) bool {
167167
filter := fmt.Sprintf("config.name=%s", api)
168168
return len(g.Runf(t, "services list --enabled --project %s --filter %s", project, filter).Array()) > 0
169169
}

helpers/foundation-deployer/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,20 @@ func main() {
112112

113113
// only enable services if they are not already enabled
114114
if globalTFVars.HasValidatorProj() {
115-
conf.ValidatorProject = *globalTFVars.ValidatorProjectId
115+
conf.ValidatorProject = *globalTFVars.ValidatorProjectID
116116
var apis []string
117117
gcpConf := gcp.NewGCP()
118118
if globalTFVars.EnableSccResourcesInTerraform != nil && *globalTFVars.EnableSccResourcesInTerraform {
119119
validatorApis = append(validatorApis, "securitycenter.googleapis.com")
120120
}
121121
for _, a := range validatorApis {
122-
if !gcpConf.IsApiEnabled(t, *globalTFVars.ValidatorProjectId, a) {
122+
if !gcpConf.IsAPIEnabled(t, *globalTFVars.ValidatorProjectID, a) {
123123
apis = append(apis, a)
124124
}
125125
}
126126
if len(apis) > 0 {
127-
fmt.Printf("# Enabling APIs: %s in validator project '%s'\n", strings.Join(apis, ", "), *globalTFVars.ValidatorProjectId)
128-
gcpConf.EnableApis(t, *globalTFVars.ValidatorProjectId, apis)
127+
fmt.Printf("# Enabling APIs: %s in validator project '%s'\n", strings.Join(apis, ", "), *globalTFVars.ValidatorProjectID)
128+
gcpConf.EnableAPIs(t, *globalTFVars.ValidatorProjectID, apis)
129129
fmt.Println("# waiting for API propagation")
130130
for i := 0; i < 20; i++ {
131131
time.Sleep(10 * time.Second)

helpers/foundation-deployer/stages/apply.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func applyEnv(t testing.TB, conf utils.GitRepo, project, region, repo, environme
628628
return gcp.NewGCP().WaitBuildSuccess(t, project, region, repo, commitSha, fmt.Sprintf("Terraform %s apply %s build Failed.", repo, environment), MaxBuildRetries)
629629
}
630630

631-
func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policyPath, validatorProjectId string) error {
631+
func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policyPath, ValidatorProjectID string) error {
632632
var err error
633633

634634
if serviceAccount != "" {
@@ -648,8 +648,8 @@ func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policy
648648
}
649649

650650
// Runs gcloud terraform vet
651-
if validatorProjectId != "" {
652-
err = TerraformVet(t, options.TerraformDir, policyPath, validatorProjectId)
651+
if ValidatorProjectID != "" {
652+
err = TerraformVet(t, options.TerraformDir, policyPath, ValidatorProjectID)
653653
if err != nil {
654654
return err
655655
}

helpers/foundation-deployer/stages/data.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ type GlobalTFVars struct {
162162
LocationGCS string `hcl:"location_gcs"`
163163
CodeCheckoutPath string `hcl:"code_checkout_path"`
164164
FoundationCodePath string `hcl:"foundation_code_path"`
165-
ValidatorProjectId *string `hcl:"validator_project_id"`
165+
ValidatorProjectID *string `hcl:"validator_project_id"`
166166
Groups Groups `hcl:"groups"`
167167
InitialGroupConfig *string `hcl:"initial_group_config"`
168168
FolderDeletionProtection *bool `hcl:"folder_deletion_protection"`
@@ -171,7 +171,7 @@ type GlobalTFVars struct {
171171

172172
// HasValidatorProj checks if a Validator Project was provided
173173
func (g GlobalTFVars) HasValidatorProj() bool {
174-
return g.ValidatorProjectId != nil && *g.ValidatorProjectId != "" && *g.ValidatorProjectId != "EXISTING_PROJECT_ID"
174+
return g.ValidatorProjectID != nil && *g.ValidatorProjectID != "" && *g.ValidatorProjectID != "EXISTING_PROJECT_ID"
175175
}
176176

177177
// HasGroupsCreation checks if Groups creation is enabled

0 commit comments

Comments
 (0)