-
Notifications
You must be signed in to change notification settings - Fork 188
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
chore: Upgrades private_link_endpoint resource to auto-generated SDK. #1901
Conversation
internal/service/privatelinkendpoint/resource_privatelink_endpoint_migration_test.go
Outdated
Show resolved
Hide resolved
internal/service/privatelinkendpoint/resource_privatelink_endpoint_migration_test.go
Outdated
Show resolved
Hide resolved
internal/service/privatelinkendpoint/resource_privatelink_endpoint_test.go
Outdated
Show resolved
Hide resolved
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" | ||
) | ||
|
||
func TestAccMigrationPrivateLinkEndpoint_basic(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not being run in CI
…oint_migration_test.go Co-authored-by: Leo Antoli <[email protected]>
…oint_migration_test.go Co-authored-by: Leo Antoli <[email protected]>
internal/service/privatelinkendpoint/resource_privatelink_endpoint_test.go
Show resolved
Hide resolved
internal/service/privatelinkendpoint/resource_privatelink_endpoint_test.go
Show resolved
Hide resolved
internal/service/privatelinkendpoint/resource_privatelink_endpoint_test.go
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one doubt
if _, ok := p.GetStatusOk(); ok { | ||
status = p.GetStatus() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: why was this if added? Can see the possibility of non Ok status resulting in a "" status while this was not the case before, so just making sure no change in behavior here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return an error if the status is not ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AgustinBettati this was added because of a fmt check error:
Formatting go files
==> Fixing linters errors...
fieldalignment -json -fix ./...
{}
golangci-lint run --fix
internal/service/privatelinkendpoint/resource_privatelink_endpoint.go:322:13: evalOrder: may want to evaluate p.GetStatus() before the return statement (gocritic)
return p, p.GetStatus(), nil
^
make: *** [lint-fix] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return an error if the status is not ok?
I think returning "" should already be enough. even if you return an error (unless you mean completely failing the whole request) will end up in a retry of the request since this code is in the refreshFunc
logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if _, ok := p.GetStatusOk(); ok { | ||
status = p.GetStatus() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we return an error if the status is not ok?
Description
Upgrades private_link_endpoint resource to auto-generated SDK.
Migration tests created.
Link to any related issue(s): CLOUDP-227301
Type of change:
Required Checklist:
Further comments