-
Notifications
You must be signed in to change notification settings - Fork 1
Implement new Index resource features - bump go-pinecone and other deps #39
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d data source plumbing
…x in order to support deletion_protection and tags for index resources, update/cleanup index resource acceptance tests
…Ready and index.Status.State
…g CreateIndexForModel when needed, validate fields in spec against type of index being created
…validate terraform state for each test
…, add acceptance tests to cover behavior for both pods and serverless
jhamon
approved these changes
Apr 16, 2025
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.
Docs stuff looks good. I didn't look much at the tests, but the rest makes sense to me.
This was referenced Apr 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
It has been a long while since we've updated the terraform provider, and the go-pinecone client the provider depends on has seen several major version bumps since then.
There are a number of new index features the provider does not currently support:
There are also a number of other dependencies that could use updating, as dependabot has dutifully let us know:
Solution
deletion_protection
,tags
,embed
, andvector_type
.IndexResource
Update
method was basically a noop, this has now been updated to support updating index tags, deletion_protection, and embed properties. Check out theUpdate
method inindex_resource.go
for specifics on how this is handled.IndexResource
Create
method also has a lot of changes to support creating various index types.IndexDataSource
andIndexResource
have been updated to include all of the new index configuration fields. For context: in terraform a "resource" is the managed thing you're creating / updating, and a data source is a "read only" representation of that thing.index_resource_test.go
, and a few other places. This was primarily to cover certain error cases and the full flow from create -> update -> destroy for indexes.Type of Change
Test Plan
You'll need to install the terraform CLI locally. Easiest way is probably through brew:
After installing terraform, find your
~/.terraformrc
file, clone this repo, and add a dev override for wherever you've built the provider binary locally. It should look something like this:Create a folder for testing the locally built provider from the cloned repo, and add a new hcl file (something like
main.tf
):mkdir pinecone-terraform-test cd pinecone-terraform-test touch main.tf
Update the
main.tf
file with your desired configuration. For example, here's a serverless integrated index:Once you've updated your
main.tf
file, you can run the following:From there you can make changes to the resource, or add new resources to the configuration file and rerun
terraform plan / terraform apply
. Use the Pinecone console to validate the external resource is created and updated as expected.