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

Validate Tiers Against API #135

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Validate Tiers Against API #135

merged 5 commits into from
Sep 12, 2024

Conversation

gene-redpanda
Copy link
Contributor

@gene-redpanda gene-redpanda commented Sep 11, 2024

Adds support for validating throughput tiers against the API endpoint added for that purpose and removes the static throughput tier validator. See commit message here for more info on why we couldn't do this through the validator.

Adds support, mocks and testing for calling the API to get the valid tiers as part of the throughput_tier validation process
Our previous solution wasn't workable. The issue is that configure is called after schema so we aren't able to create a client that can be passed through to the validator. And unfortunately the Schema function is called with an empty struct for request so we can't access it there either (the original gameplan). An alternative path was passing connections/clients into the resource through the provider's Resources function but this is called before the provider's Configure so it also can't access the relevant client/connection.

This commit resolves the issue by eliminating the validator and handling tier validation prior to the cluster create call. This should slightly speed things along but isn't the meaningful advantage over having the API invalidate us that the prior validator method (which runs at the plan stage and is massively faster but unfortunately working off static info) brought. There is a possible solution but it comes from the API: don't require ID/Secret to access the throughput tier endpoint. This seems out of scope at this time.
@gene-redpanda gene-redpanda marked this pull request as ready for review September 11, 2024 19:53
@gene-redpanda gene-redpanda merged commit dcb18b4 into main Sep 12, 2024
11 checks passed
@gene-redpanda gene-redpanda deleted the add-tiers-call branch September 12, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants