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

HUBS-2073 Source changes #76

Merged
merged 21 commits into from
Mar 21, 2024
Merged

HUBS-2073 Source changes #76

merged 21 commits into from
Mar 21, 2024

Conversation

ankit-patil-hubs
Copy link
Contributor

@ankit-patil-hubs ankit-patil-hubs commented Feb 28, 2024

Problem:

  • Terraform SDK upgrade to v2
  • Add new resource to add source config, supported only for Postgres currently

Solution:

  • As the new source API needs repository id as input made changes to environment resource to persist repositories in state file.

  • Fedex had complained about vdb operation not working subsequently after dsource , made a change in appdata resource and oracle resource to poll the get_snapshot_by_dsourceID API after dsource job polling is completed. This will be the default behavior going forward and can be controlled by two new optional flags

  •            skip_wait_for_snapshot_creation - default - false
    
  •            wait_time - default - 3 mins
    

Testing

ankit.patil@Ankit-Patils-MacBook-Pro terraform-provider-delphix % TESTARGS="-run Test_source_create_positive"  make testacc
TF_ACC=1 go test $(go list ./... | grep -v 'vendor') -v -run Test_source_create_positive -timeout 120m
?       terraform-provider-delphix      [no test files]
=== RUN   Test_source_create_positive
[DELPHIX] [INFO] 2024/03/12 19:47:18 Job result is COMPLETED
[DELPHIX] [INFO] 2024/03/12 19:47:19 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2024/03/12 19:47:25 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2024/03/12 19:47:31 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2024/03/12 19:47:37 Job result is COMPLETED
[DELPHIX] [INFO] 2024/03/12 19:47:43 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2024/03/12 19:47:52 Job result is COMPLETED
[DELPHIX] [INFO] 2024/03/12 19:47:53 [OK] Breaking poll - Status 404 reached.
--- PASS: Test_source_create_positive (55.05s)
PASS
ok      terraform-provider-delphix/internal/provider    56.417s
ankit.patil@Ankit-Patils-MacBook-Pro terraform-provider-delphix % make install
go build -o terraform-provider-delphix
mkdir -p ~/.terraform.d/plugins/delphix.com/dct/delphix/4.0.0/darwin_amd64
mv terraform-provider-delphix ~/.terraform.d/plugins/delphix.com/dct/delphix/4.0.0/darwin_amd64
ankit.patil@Ankit-Patils-MacBook-Pro terraform-provider-delphix % cd examples/appdata_dsource 


delphix_environment.unixsrc: Creating...
time_sleep.wait_30_seconds: Still creating... [10s elapsed]
delphix_environment.unixsrc: Still creating... [10s elapsed]
delphix_environment.unixtgt: Still creating... [10s elapsed]
time_sleep.wait_30_seconds: Still creating... [20s elapsed]
delphix_environment.unixsrc: Still creating... [20s elapsed]
delphix_environment.unixtgt: Still creating... [20s elapsed]
time_sleep.wait_30_seconds: Still creating... [30s elapsed]
time_sleep.wait_30_seconds: Creation complete after 30s [id=2024-03-20T14:58:08Z]
delphix_environment.unixsrc: Still creating... [30s elapsed]
delphix_environment.unixtgt: Still creating... [30s elapsed]
delphix_environment.unixsrc: Creation complete after 40s [id=13-UNIX_HOST_ENVIRONMENT-120]
delphix_database_postgresql.name: Creating...
delphix_environment.unixtgt: Still creating... [40s elapsed]
delphix_database_postgresql.name: Creation complete after 3s [id=13-APPDATA_STAGED_SOURCE_CONFIG-119]
delphix_appdata_dsource.ds1: Creating...
delphix_environment.unixtgt: Creation complete after 50s [id=13-UNIX_HOST_ENVIRONMENT-119]
delphix_appdata_dsource.ds1: Still creating... [10s elapsed]
delphix_appdata_dsource.ds1: Still creating... [20s elapsed]
delphix_appdata_dsource.ds1: Still creating... [30s elapsed]
delphix_appdata_dsource.ds1: Still creating... [40s elapsed]
delphix_appdata_dsource.ds1: Still creating... [50s elapsed]
delphix_appdata_dsource.ds1: Still creating... [1m0s elapsed]
delphix_appdata_dsource.ds1: Still creating... [1m10s elapsed]
delphix_appdata_dsource.ds1: Creation complete after 1m20s [id=13-APPDATA_CONTAINER-144]
delphix_vdb.example: Creating...
delphix_vdb.example: Still creating... [10s elapsed]
delphix_vdb.example: Still creating... [20s elapsed]
delphix_vdb.example: Creation complete after 27s [id=13-APPDATA_CONTAINER-145]

@nick-mathison
Copy link
Contributor

nick-mathison commented Mar 4, 2024

      wait_time - default - 3 mins

What type of input does this value take? I assume integer?

And for the two default values, if they are left blank, it will be "false" and "3"?

Edit: NVM I see it in the code

go.mod Show resolved Hide resolved
Copy link
Contributor

@Uddipaan-Hazarika Uddipaan-Hazarika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/database_postgresql.md Outdated Show resolved Hide resolved
docs/resources/oracle_dsource.md Outdated Show resolved Hide resolved
docs/resources/oracle_dsource.md Outdated Show resolved Hide resolved
docs/resources/appdata_dsource.md Outdated Show resolved Hide resolved
docs/resources/appdata_dsource.md Outdated Show resolved Hide resolved
@elima-sugunan elima-sugunan changed the title Source changes HUBS-2073 Source changes Mar 21, 2024
@Uddipaan-Hazarika Uddipaan-Hazarika removed the request for review from nick-mathison March 21, 2024 07:44
@ankit-patil-hubs ankit-patil-hubs dismissed nick-mathison’s stale review March 21, 2024 07:45

All the suggested changes are incorporated

@ankit-patil-hubs ankit-patil-hubs merged commit f426207 into develop Mar 21, 2024
2 checks passed
@ankit-patil-hubs ankit-patil-hubs deleted the source_changes branch April 29, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants