Skip to content

Commit a662fba

Browse files
ritek01Harness
authored andcommitted
fix: [PIPE-29954]: update go-sdk version (#1303)
* 2068fa fixed template test * 6666ab updated harness-go-sdk * c3d852 fix testAccResourcePipelineImportFromGit Test * b29396 update go-sdk version
1 parent 92976e6 commit a662fba

File tree

4 files changed

+17
-29
lines changed

4 files changed

+17
-29
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/aws/aws-sdk-go v1.46.4
1010
github.com/docker/docker v28.3.2+incompatible
1111
github.com/google/uuid v1.6.0
12-
github.com/harness/harness-go-sdk v0.6.0
12+
github.com/harness/harness-go-sdk v0.6.1
1313
github.com/harness/harness-openapi-go-client v0.0.25
1414
github.com/hashicorp/go-cleanhttp v0.5.2
1515
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
7878
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7979
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
8080
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
81-
github.com/harness/harness-go-sdk v0.6.0 h1:iKp7HrJL/mH5CJph1KGH+yqZMZZTvN/d9zogGyycRxc=
82-
github.com/harness/harness-go-sdk v0.6.0/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
81+
github.com/harness/harness-go-sdk v0.6.1 h1:Bxbqx2/wXmXh7Yo5xd4Q28/4XHnMUL2MtDLIkgfuRQg=
82+
github.com/harness/harness-go-sdk v0.6.1/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
8383
github.com/harness/harness-openapi-go-client v0.0.25 h1:s1ALpC6cCJCMBkEVPjAjyHTPEpBfPyV78TeXpp3CEoU=
8484
github.com/harness/harness-openapi-go-client v0.0.25/go.mod h1:u0vqYb994BJGotmEwJevF4L3BNAdU9i8ui2d22gmLPA=
8585
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=

internal/service/pipeline/pipeline/resource_pipeline_test.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ func TestAccResourcePipelineInline(t *testing.T) {
9393
}
9494

9595
func TestAccResourcePipelineImportFromGit(t *testing.T) {
96-
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(6))
97-
name := id
9896

9997
resourceName := "harness_platform_pipeline.test"
10098

@@ -104,7 +102,7 @@ func TestAccResourcePipelineImportFromGit(t *testing.T) {
104102
CheckDestroy: testAccPipelineDestroy(resourceName),
105103
Steps: []resource.TestStep{
106104
{
107-
Config: testAccResourcePipelineImportFromGit(id, name),
105+
Config: testAccResourcePipelineImportFromGit(),
108106
Check: resource.ComposeTestCheckFunc(
109107
resource.TestCheckResourceAttr(resourceName, "id", "gitx"),
110108
resource.TestCheckResourceAttr(resourceName, "name", "gitx"),
@@ -411,12 +409,8 @@ func testAccResourcePipelineInline(id string, name string) string {
411409
`, id, name)
412410
}
413411

414-
func testAccResourcePipelineImportFromGit(id string, name string) string {
412+
func testAccResourcePipelineImportFromGit() string {
415413
return fmt.Sprintf(`
416-
resource "harness_platform_organization" "test" {
417-
identifier = "%[1]s"
418-
name = "%[2]s"
419-
}
420414
resource "harness_platform_project" "Project_Test" {
421415
identifier = "TF_GitX_Pipeline_Test"
422416
name = "TF_GitX_Pipeline_Test"
@@ -425,8 +419,8 @@ func testAccResourcePipelineImportFromGit(id string, name string) string {
425419
}
426420
resource "harness_platform_pipeline" "test" {
427421
identifier = "gitx"
428-
org_id = "default"
429-
project_id = "TF_GitX_Pipeline_Test"
422+
org_id = harness_platform_project.Project_Test.org_id
423+
project_id = harness_platform_project.Project_Test.id
430424
name = "gitx"
431425
import_from_git = true
432426
git_import_info {
@@ -440,7 +434,7 @@ func testAccResourcePipelineImportFromGit(id string, name string) string {
440434
pipeline_description = "Pipeline Description"
441435
}
442436
}
443-
`, id, name)
437+
`)
444438
}
445439

446440
func testAccResourcePipelineHC(id string, name string) string {

internal/service/pipeline/template/resource_template_test.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ func TestAccResourceTemplate_OrgScopeInline(t *testing.T) {
178178
}
179179

180180
func TestAccResourceTemplate_OrgScopeImportFromGit(t *testing.T) {
181-
id := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(6))
182-
name := id
183181

184182
resourceName := "harness_platform_template.test"
185183

@@ -193,10 +191,10 @@ func TestAccResourceTemplate_OrgScopeImportFromGit(t *testing.T) {
193191
CheckDestroy: testAccTemplateDestroy(resourceName),
194192
Steps: []resource.TestStep{
195193
{
196-
Config: testAccResourceTemplateOrgScopeImportFromGit(id, name),
194+
Config: testAccResourceTemplateOrgScopeImportFromGit(),
197195
Check: resource.ComposeTestCheckFunc(
198-
resource.TestCheckResourceAttr(resourceName, "id", "orgtemplate"),
199-
resource.TestCheckResourceAttr(resourceName, "name", "orgtemplate"),
196+
resource.TestCheckResourceAttr(resourceName, "id", "orgtemplate2"),
197+
resource.TestCheckResourceAttr(resourceName, "name", "orgtemplate2"),
200198
),
201199
},
202200
{
@@ -1399,26 +1397,22 @@ func testAccResourceTemplateProjectScopeInline(id string, name string) string {
13991397
`, id, name)
14001398
}
14011399

1402-
func testAccResourceTemplateOrgScopeImportFromGit(id string, name string) string {
1400+
func testAccResourceTemplateOrgScopeImportFromGit() string {
14031401
return fmt.Sprintf(`
1404-
resource "harness_platform_organization" "test" {
1405-
identifier = "%[1]sorg"
1406-
name = "%[2]s"
1407-
}
14081402
resource "harness_platform_template" "test" {
1409-
identifier = "orgtemplate"
1403+
identifier = "orgtemplate2"
14101404
org_id = "default"
1411-
name = "orgtemplate"
1405+
name = "orgtemplate2"
14121406
version = "v2"
14131407
import_from_git = true
14141408
git_import_details {
14151409
branch_name = "main"
1416-
file_path = ".harness/orgtemplate.yaml"
1410+
file_path = ".harness/orgtemplate2.yaml"
14171411
connector_ref = "account.TF_open_repo_github_connector"
14181412
repo_name = "open-repo"
14191413
}
14201414
template_import_request {
1421-
template_name = "orgtemplate"
1415+
template_name = "orgtemplate2"
14221416
template_version = "v2"
14231417
template_description = ""
14241418
}
@@ -1432,7 +1426,7 @@ func testAccResourceTemplateOrgScopeImportFromGit(id string, name string) string
14321426
resource "null_resource" "next" {
14331427
depends_on = [time_sleep.wait_4_seconds]
14341428
}
1435-
`, id, name)
1429+
`)
14361430
}
14371431

14381432
func testAccResourceTemplateProjectScopeImportFromGit(id string, name string) string {

0 commit comments

Comments
 (0)