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

[CDK] Validate source endpoint and add default port if missing #1125

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

lewijacn
Copy link
Collaborator

@lewijacn lewijacn commented Nov 7, 2024

Description

Validate endpoints for source and target and add default ports if missing. This should result in a consistent pattern for our endpoints in CDK and prevent Capture Proxy errors from providing a destinationURI without a port.

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2035

Is this a backport? If so, please add backport PR # and/or commits #

Testing

CDK testing

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.54%. Comparing base (bcd38c6) to head (3d8a2ce).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1125   +/-   ##
=========================================
  Coverage     80.54%   80.54%           
  Complexity     2907     2907           
=========================================
  Files           393      393           
  Lines         14630    14630           
  Branches       1007     1007           
=========================================
  Hits          11784    11784           
  Misses         2233     2233           
  Partials        613      613           
Flag Coverage Δ
gradle-test 78.65% <ø> (ø)
python-test 90.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

const deployId = props.addOnMigrationDeployId ? props.addOnMigrationDeployId : props.defaultDeployId;
createMigrationStringParameter(this, formattedClusterEndpoint, {
createMigrationStringParameter(this, props.targetClusterEndpoint, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did this line change? From the rest of the PR, I can't figure that out.

Copy link
Member

Choose a reason for hiding this comment

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

props.targetClusterEndpoint is already formatted from calling validateAndReturnFormattedHttpURL from parseClusterDefinition in stack-composer.

This now parsed/formatted endpoint that is in targetCluster.endpoint is passed as props.targetClusterEndpoint rendering formatting in this stack unnecessary.

Implementation LGTM

@gregschohn gregschohn merged commit a9badc5 into opensearch-project:main Nov 12, 2024
15 checks passed
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.

3 participants