Skip to content

Commit 826e662

Browse files
authored
Fix TestAccDataSourceNotFound test (#27)
Signed-off-by: abarreiro <abarreiro@vmware.com>
1 parent 2f4c5ca commit 826e662

File tree

6 files changed

+28
-5
lines changed

6 files changed

+28
-5
lines changed

.changes/v1.0.0/27-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add GitHub Action to detect replaced go-vcloud-director SDK in `go.mod` in PRs [GH-27]

.github/workflows/check-mod.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: check-mod
2+
on:
3+
pull_request
4+
5+
jobs:
6+
build:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
- name: Check out code into the Go module directory
12+
uses: actions/checkout@v3
13+
14+
- name: No replaced Go module
15+
run: |
16+
set +e
17+
grep 'replace github.com/vmware/go-vcloud-director' go.mod
18+
if [ "$?" -eq 0 ]; then echo "ERROR: Found a replaced go.mod. Remove the replacement before merging"; exit 1; else exit 0; fi

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
77
github.com/hashicorp/go-version v1.7.0
88
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
9-
github.com/vmware/go-vcloud-director/v3 v3.0.0-alpha.24
9+
github.com/vmware/go-vcloud-director/v3 v3.0.0-alpha.25
1010
)
1111

1212
require (
@@ -66,5 +66,3 @@ require (
6666
google.golang.org/protobuf v1.35.1 // indirect
6767
sigs.k8s.io/yaml v1.4.0 // indirect
6868
)
69-
70-
replace github.com/vmware/go-vcloud-director/v3 => github.com/adambarreiro/go-vcloud-director/v3 v3.0.0-20250130150058-c5c28c2bb173

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc
44
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
55
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg=
66
github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
7-
github.com/adambarreiro/go-vcloud-director/v3 v3.0.0-20250130150058-c5c28c2bb173 h1:WwtoMKQfBr9L1ezqTgRVA/ZutaFDZBFsi3HoC8wY8Do=
8-
github.com/adambarreiro/go-vcloud-director/v3 v3.0.0-20250130150058-c5c28c2bb173/go.mod h1:68KHsVns52dsq/w5JQYzauaU/+NAi1FmCxhBrFc/VoQ=
97
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
108
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
119
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
@@ -151,6 +149,8 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU
151149
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
152150
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
153151
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
152+
github.com/vmware/go-vcloud-director/v3 v3.0.0-alpha.25 h1:THyQ5FnlrZxV9GeCfmQytvdnE9rdfsPf8hT+LmfNsCY=
153+
github.com/vmware/go-vcloud-director/v3 v3.0.0-alpha.25/go.mod h1:68KHsVns52dsq/w5JQYzauaU/+NAi1FmCxhBrFc/VoQ=
154154
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
155155
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
156156
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=

vcfa/datasource_not_found_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ func addMandatoryParams(dataSourceName string, mandatoryFields []string, t *test
153153
templateFields = templateFields + `edge_cluster_id = "urn:vcloud:edgeCluster:12345678-1234-1234-1234-123456789012"` + "\n"
154154
case "content_library_id":
155155
templateFields = templateFields + `content_library_id = "urn:vcloud:contentLibrary:12345678-1234-1234-1234-123456789012"` + "\n"
156+
case "alias": // vcfa_certificate
157+
templateFields = templateFields + `alias = "non-existent-certificate"` + "\n"
158+
case "username": // vcfa_org_local_user
159+
templateFields = templateFields + `username = "non-existent-local-user"` + "\n"
160+
case "org_regional_networking_id":
161+
templateFields = templateFields + `org_regional_networking_id = "urn:vcloud:regionalNetworkingSetting:12345678-1234-1234-1234-123456789012"` + "\n"
156162
}
157163
}
158164

0 commit comments

Comments
 (0)