Skip to content

Commit

Permalink
[Internal] Load auto-generated resources and data sources (#4367)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->
This PR adds a placeholder file that will load any future auto-generated
resources and data sources. The file itself will be auto-generated along
with the resources and data sources.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework

Co-authored-by: Omer Lachish <[email protected]>
  • Loading branch information
rauchy and rauchy authored Jan 3, 2025
1 parent bc6518a commit abb2b36
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 17 deletions.
13 changes: 13 additions & 0 deletions internal/providers/pluginfw/auto_generation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 23 additions & 17 deletions internal/providers/pluginfw/pluginfw_rollout_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,32 @@ var migratedDataSources = []func() datasource.DataSource{

// List of resources that have been onboarded to the plugin framework - not migrated from sdkv2.
// Keep this list sorted.
var pluginFwOnlyResources = []func() resource.Resource{
app.ResourceApp,
sharing.ResourceShare,
}
var pluginFwOnlyResources = append(
[]func() resource.Resource{
app.ResourceApp,
sharing.ResourceShare,
},
autoGeneratedResources...,
)

// List of data sources that have been onboarded to the plugin framework - not migrated from sdkv2.
// Keep this list sorted.
var pluginFwOnlyDataSources = []func() datasource.DataSource{
app.DataSourceApp,
app.DataSourceApps,
catalog.DataSourceFunctions,
notificationdestinations.DataSourceNotificationDestinations,
registered_model.DataSourceRegisteredModel,
registered_model.DataSourceRegisteredModelVersions,
serving.DataSourceServingEndpoints,
// TODO: Add DataSourceCluster into migratedDataSources after fixing unit tests.
cluster.DataSourceCluster, // Using the staging name (with pluginframework suffix)
sharing.DataSourceShare, // Using the staging name (with pluginframework suffix)
sharing.DataSourceShares, // Using the staging name (with pluginframework suffix)
}
var pluginFwOnlyDataSources = append(
[]func() datasource.DataSource{
app.DataSourceApp,
app.DataSourceApps,
catalog.DataSourceFunctions,
notificationdestinations.DataSourceNotificationDestinations,
registered_model.DataSourceRegisteredModel,
registered_model.DataSourceRegisteredModelVersions,
serving.DataSourceServingEndpoints,
// TODO: Add DataSourceCluster into migratedDataSources after fixing unit tests.
cluster.DataSourceCluster, // Using the staging name (with pluginframework suffix)
sharing.DataSourceShare, // Using the staging name (with pluginframework suffix)
sharing.DataSourceShares, // Using the staging name (with pluginframework suffix)
},
autoGeneratedDataSources...,
)

type sdkV2FallbackOptions struct {
resourceFallbacks []string
Expand Down

0 comments on commit abb2b36

Please sign in to comment.