Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to use Go 1.21 and use TF SDK v2 #116

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

brucedewald
Copy link

NOTE: Before this PR can be merged vinyldns/go-vinyldns#94 must be merged and a new version of go-vinydns released to update in go.mod in this PR. I will keep this in a draft until that happens and then update this PR.

This PR does the following:

  • Updating to use go 1.21 from 1.17 which was EOL'd in Aug 2022
  • Upgrading to Terraform SDKv2 as SDKv1 was EOL'd in July 2021
    • Required updating some tests as v2 does not use hashes, but rather indexes for stored attributes
    • hashcode function is deprecated in SDKv2 so included it
    • other minor changes due to v2 differences
  • Modified Makefile to more closely resemble go-vinyldns Makefile for consistency in Go projects

The goal of this PR is to have no functional changes, but just update it to current packages so that future PRs to add features are less cluttered & easier to review. As well, the goal was to update from older packages that have vulnerabilities

Tests run

 make all
test -z ""
go vet ./...
GO111MODULE=on go test ./... -cover
?       github.com/vinyldns/terraform-provider-vinyldns [no test files]
ok      github.com/vinyldns/terraform-provider-vinyldns/vinyldns        (cached)        coverage: 6.9% of statements
GO111MODULE=on go build -ldflags "-X main.version=" ./...
if [ ! -d  "/Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns" ]; then \
                echo "github.com/vinyldns/vinyldns not found in your GOPATH (necessary for acceptance tests), getting..."; \
                git clone \
                        https://github.com/vinyldns/vinyldns \
                        "/Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns"; \
        else \
                git -C "/Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns" pull ; \
        fi
Already up to date.
/Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns/quickstart/quickstart-vinyldns.sh \
                --clean
Killing running containers...
413c74bf0c84
ed6ccb2a1482
Removing containers...
413c74bf0c84
ed6ccb2a1482
Deleted Networks:
vinyldns_net

Clean up completed!
/Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns/quickstart/quickstart-vinyldns.sh \
                --api
Starting VinylDNS (latest) the background...
[+] Running 4/5
 ⠸ Network vinyldns_net                                                                                                                                       Created                                                                                          0.3s 
 ✔ Container vinyldns-api-integration                                                                                                                         Started                                                                                          0.2s 
 ! integration The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                                                                                  0.0s 
 ✔ Container vinyldns-api                                                                                                                                     Started                                                                                          0.3s 
 ! api The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                                                                                          0.0s 

Waiting for VinylDNS API at http://localhost:9000 .......................................OK

VinylDNS API started! You can connect to the API via http://localhost:9000
To clean up the running containers:
    /Users/bdewald/go/1.21.9/src/github.com/vinyldns/vinyldns/quickstart/quickstart-vinyldns.sh --clean
VINYLDNS_ACCESS_KEY=okAccessKey \
        VINYLDNS_SECRET_KEY=okSecretKey \
        VINYLDNS_HOST=http://localhost:9000 \
        TF_LOG=ERROR \
        TF_ACC=1 \
        go test "./..." -v -cover
?       github.com/vinyldns/terraform-provider-vinyldns [no test files]
=== RUN   TestAccVinylDNSZoneDataSource_basic
--- PASS: TestAccVinylDNSZoneDataSource_basic (1.07s)
=== RUN   Test_parseTwoPartID
--- PASS: Test_parseTwoPartID (0.00s)
=== RUN   Test_parseTwoPartIDIncorrectSeparator
--- PASS: Test_parseTwoPartIDIncorrectSeparator (0.00s)
=== RUN   Test_removeBrackets
--- PASS: Test_removeBrackets (0.00s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestGetUserAgent
=== RUN   TestGetUserAgent/empty_version
=== RUN   TestGetUserAgent/version_set
=== RUN   TestGetUserAgent/version_set#01
--- PASS: TestGetUserAgent (0.00s)
    --- PASS: TestGetUserAgent/empty_version (0.00s)
    --- PASS: TestGetUserAgent/version_set (0.00s)
    --- PASS: TestGetUserAgent/version_set#01 (0.00s)
=== RUN   TestAccVinylDNSGroupBasic
--- PASS: TestAccVinylDNSGroupBasic (2.31s)
=== RUN   TestAccVinylDNSGroupWithoutDescription
--- PASS: TestAccVinylDNSGroupWithoutDescription (5.68s)
=== RUN   TestVinylDNSRecordSetMigrateStateID
--- PASS: TestVinylDNSRecordSetMigrateStateID (0.00s)
=== RUN   TestVinylDNSRecordSetMigrateStateRecordTexts
--- PASS: TestVinylDNSRecordSetMigrateStateRecordTexts (0.00s)
=== RUN   TestAccVinylDNSRecordSetBasic
--- PASS: TestAccVinylDNSRecordSetBasic (7.20s)
=== RUN   TestAccVinylDNSRecordSetMoveZones
--- PASS: TestAccVinylDNSRecordSetMoveZones (5.66s)
=== RUN   TestAccVinylDNSZoneBasic
{{system-test. [email protected] Active 2024-04-17T00:34:27Z e79a11d0-bd15-4491-9aea-81c65b130cf8 e6e8ea74-513a-4861-8ab9-7979c575401e 2024-04-17T00:34:27Z 2024-04-17T00:34:28Z system   <nil> <nil> 0x1400040a360 false true} ok Update Synced 2024-04-17T00:34:28Z 9c3c6397-061e-484c-afe8-0c5900ce4907}
--- PASS: TestAccVinylDNSZoneBasic (4.28s)
=== RUN   TestAccVinylDNSZoneWithACL
{{system-test. [email protected] Active 2024-04-17T00:34:31Z f753e332-abda-4008-aeb0-46eb4230fde5 a6d0ddfc-f608-4bc1-a2c9-3e5785fdd43a 2024-04-17T00:34:31Z 2024-04-17T00:34:32Z system   <nil> <nil> 0x140005920f0 false true} ok Update Synced 2024-04-17T00:34:32Z 1fbcbb0a-7b15-46bd-b815-7a87610588e1}
--- PASS: TestAccVinylDNSZoneWithACL (4.23s)
=== RUN   TestAccVinylDNSZoneWithACLAndNoRecordTypes
{{system-test. [email protected] Active 2024-04-17T00:34:35Z e8eb8cea-387a-4c05-b028-342e762e4baf 6d17d446-f1bf-4c02-a3c6-6da48836e183 2024-04-17T00:34:35Z 2024-04-17T00:34:37Z system   <nil> <nil> 0x14001250228 false true} ok Update Synced 2024-04-17T00:34:37Z fa26b3bd-3a31-4928-9594-a85505144295}
--- PASS: TestAccVinylDNSZoneWithACLAndNoRecordTypes (4.35s)
=== RUN   TestAccVinylDNSZoneWithConnection
{{system-test. [email protected] Active 2024-04-17T00:34:40Z 459df2c0-9916-4317-ac8b-f698982c37bf e7b6b4cb-0b46-4b40-b24c-267c1c7b3f8a 2024-04-17T00:34:40Z 2024-04-17T00:34:41Z system   0x140003348c0 <nil> 0x140005922b8 false true} ok Update Synced 2024-04-17T00:34:41Z d5b35c0e-89a0-4b1d-8a3e-a6a1c58a8f93}
--- PASS: TestAccVinylDNSZoneWithConnection (4.25s)
=== RUN   TestAccVinylDNSZoneWithTransferConnection
{{system-test. [email protected] Active 2024-04-17T00:34:44Z b582dd6a-f88a-4b8d-97ff-92565d58e326 1305b7ac-90ea-4ea8-89f9-7ce46ce6b0ba 2024-04-17T00:34:44Z 2024-04-17T00:34:45Z system   <nil> 0x140004e6480 0x1400000e288 false true} ok Update Synced 2024-04-17T00:34:45Z 0622b99b-bca6-42f6-ab92-c7ec3c84d0bd}
--- PASS: TestAccVinylDNSZoneWithTransferConnection (4.10s)
PASS
coverage: 74.4% of statements
ok      github.com/vinyldns/terraform-provider-vinyldns/vinyldns        (cached)        coverage: 74.4% of statements
GO111MODULE=on go install ./...
mkdir -p "${HOME}/.terraform.d/plugins/local/vinyldns-provider/vinyldns//$(go env GOOS)_$(go env GOARCH)/"
cp "$(go env GOPATH)/bin/terraform-provider-vinyldns" "${HOME}/.terraform.d/plugins/local/vinyldns-provider/vinyldns//$(go env GOOS)_$(go env GOARCH)/"

@brucedewald brucedewald changed the title Update dependencies to use Go 1.21, support VinylDNS 0.20.0, and use TF SDK v2 Update dependencies to use Go 1.21 and use TF SDK v2 Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant