You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support DeletionProtection, index configure command, and bump go-pinecone from v0.5.0 -> v1.1.0 (#16)
## Problem
Currently the CLI relies on `v0.5.0` of the `go-pinecone` SDK. We've
since released `v1.1.0` of `go-pinecone` and would like to bump the
dependency within the CLI.
`v1.0.0` added `DeletionProtection` for indexes, which wasn't supported
in either `index create-pod`, `index create-serverless`, or any of the
other index operations. Additionally, while working on this I noticed we
don't currently support an `index configure` command.
## Solution
- Bump the `go-pinecone` dependency from `v0.5.0` -> `v1.1.0`. There
were no major API changes that needed to be accounted for in the CLI
because of this update.
- Add `deletion_protection` as an optional argument for both `index
create-pod` and `index create-serverless` commands.
- Print `DeletionProtection` as a part of the `PrintDescribeIndexTable`
presenter.
- Add new `/command/index/configure.go` command to allow configuring
indexes through the CLI. Use the command in `/command/index/cmd.go`.
- Fix errors being swallowed when calling `index delete` command.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [ ] Non-code change (docs, etc)
- [ ] None of the above: (explain here)
## Test Plan
CLI functionality should remain largely unchanged. You can pull this
branch down and install `goreleaser` to build and test locally:
```
# build CLI locally
goreleaser build --single-target --snapshot --clean
# login or set-api-key manually
./dist/pinecone_darwin_arm64/pinecone login
./dist/pinecone_darwin_arm64/pinecone config set-api-key "YOUR_API_KEY"
# work with indexes
./dist/pinecone_darwin_arm64/pinecone index list
./dist/pinecone_darwin_arm64/pinecone index create-pod -n "test-cli-create-pod" -d 3 -m "cosine" -e "us-east-1-aws" -t "p1.x1" --deletion_protection "enabled"
./dist/pinecone_darwin_arm64/pinecone index configure -n "test-cli-create_pod" -p "disabled"
./dist/pinecone_darwin_arm64/pinecone index describe --name test-cli-create-pod
```
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1208161607942737
cmd.Flags().Int32VarP(&options.shards, "shards", "s", 1, "shards of the index to create")
57
58
cmd.Flags().Int32VarP(&options.replicas, "replicas", "r", 1, "replicas of the index to create")
58
59
cmd.Flags().StringVarP(&options.sourceCollection, "source_collection", "c", "", "When creating a pod index using data from a collection, the name of the source collection")
60
+
cmd.Flags().StringVarP(&options.deletionProtection, "deletion_protection", "p", "", "Whether to enable deletion protection for the index")
0 commit comments