-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
core: ResourceProvider.GetSchema method #16352
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package terraform | ||
|
||
import ( | ||
"github.com/hashicorp/terraform/config/configschema" | ||
) | ||
|
||
type Schemas struct { | ||
Providers ProviderSchemas | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (this seemingly-unnecessary container will grow to include provisioner schemas in a later commit) |
||
} | ||
|
||
// ProviderSchemas is a map from provider names to provider schemas. | ||
// | ||
// The names in this map are the direct plugin name (e.g. "aws") rather than | ||
// any alias name (e.g. "aws.foo"), since. | ||
type ProviderSchemas map[string]*ProviderSchema | ||
|
||
// ProviderSchema represents the schema for a provider's own configuration | ||
// and the configuration for some or all of its resources and data sources. | ||
// | ||
// The completeness of this structure depends on how it was constructed. | ||
// When constructed for a configuration, it will generally include only | ||
// resource types and data sources used by that configuration. | ||
type ProviderSchema struct { | ||
Provider *configschema.Block | ||
ResourceTypes map[string]*configschema.Block | ||
DataSources map[string]*configschema.Block | ||
} | ||
|
||
// ProviderSchemaRequest is used to describe to a ResourceProvider which | ||
// aspects of schema are required, when calling the GetSchema method. | ||
type ProviderSchemaRequest struct { | ||
ResourceTypes []string | ||
DataSources []string | ||
} |
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.
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.
Shouldn't the protocol version indicate if we support the correct methods?
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.
This field is being used to avoid incrementing the protocol version so that we don't create a provider plugin compatibility wall yet. There will be some bigger changes to the provider protocol coming later, so the desire is to get it all out in a single increment so we can avoid putting users through that upgrade pain multiple times.
(If we increment the plugin protocol version then new provider releases become incompatible with older core versions, which returns us to the sad old world where you need to upgrade core in order to get the latest provider features. Tolerable to do once or twice, but not something I want to make a habit of...)
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.
gotcha, just making sure I understood why the workaround was here.