-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS : Add fs and inmem state storage implementationd to the builtin simplev6 provider, update grpcwrap package, use PSS implementation in E2E test
#37790
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
base: main
Are you sure you want to change the base?
Conversation
| // InMemStoreSingle allows 'storing' state in memory for the purpose of testing. | ||
| // | ||
| // "Single" reflects the fact that this implementation does not use any global scope vars | ||
| // in its implementation, unlike the current inmem backend. HOWEVER, you can test whether locking | ||
| // blocks multiple clients trying to access the same state at once by creating multiple instances | ||
| // of backend.Backend that wrap the same provider.Interface instance. | ||
| type InMemStoreSingle struct { | ||
| states stateMap | ||
| locks lockMap |
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.
For context, the inmem backend uses these global vars:
terraform/internal/backend/remote-state/inmem/backend.go
Lines 24 to 30 in efb2a1c
| // we keep the states and locks in package-level variables, so that they can be | |
| // accessed from multiple instances of the backend. This better emulates | |
| // backend instances accessing a single remote data store. | |
| var ( | |
| states stateMap | |
| locks lockMap | |
| ) |
Like the code comment says, multiple backends can attempt to access the same state by using the same providers.Interface instance to create them.
inmem state storage implementation to the builtin terraform providerinmem state storage implementation to the builtin terraform provider, update grpcwrap package, use PSS implementation in E2E test
a4887d9 to
ef6dc39
Compare
.github/workflows/checks.yml
Outdated
| run: | | ||
| TF_ACC=1 go test -v ./internal/command/e2etest | ||
| TF_TEST_EXPERIMENT=1 TF_ACC=1 go test -v ./internal/command/e2etest |
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.
Something to bear in mind is that E2E tests also run in the context of the build workflow. I think it'd best to avoid enabling experiments to leak to that workflow, and instead have experimental tests skipped when running in that context.
0f01ff6 to
2fadb1e
Compare
inmem state storage implementation to the builtin terraform provider, update grpcwrap package, use PSS implementation in E2E testfs and inmem state storage implementationd to the builtin simplev6 provider, update grpcwrap package, use PSS implementation in E2E test
…nfig parsing needs to be explicitly added
… can use already parsed config
…eds to be refactored
…in use within operations backend
…to make relationship to (Meta).Backend more obvious.
…tations, pass through requests to matching store based on type name.
… implementation; add embeddable unimplementedProviderInterface struct
…orm provider. Stop people using it unless TF_ACC is set.
…pace state already.
…n terraform provider
…they can be reused.
…ther work to allow PSS to be used with other commands.
This provider is not accessible to users so it's unnecessary.
Seeing as I was in this part of the code during this branch's work
727ae19 to
8f77b19
Compare
This PR enables E2E testing with pluggable state storage:
grpcwrappackage, which is needed to allow provider-like code in Core to behave like it's a real separate provider plugin.inmemandfsstate store in the v6 version ofterraform-provider-simpleTarget Release
N/A
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry