Fix data source references (#61)
Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
49ec81ae25
commit
175ce93f85
21 changed files with 69 additions and 69 deletions
|
|
@ -31,12 +31,12 @@ type clusterDataSource struct {
|
|||
client *ske.APIClient
|
||||
}
|
||||
|
||||
// Metadata returns the resource type name.
|
||||
// Metadata returns the data source type name.
|
||||
func (r *clusterDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_ske_cluster"
|
||||
}
|
||||
|
||||
// Configure adds the provider configured client to the resource.
|
||||
// Configure adds the provider configured client to the data source.
|
||||
func (r *clusterDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
// Prevent panic if the provider has not been configured.
|
||||
if req.ProviderData == nil {
|
||||
|
|
@ -76,7 +76,7 @@ func (r *clusterDataSource) Schema(_ context.Context, _ datasource.SchemaRequest
|
|||
Description: "SKE Cluster data source schema.",
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
Description: "Terraform's internal resource ID. It is structured as \"`project_id`,`name`\".",
|
||||
Description: "Terraform's internal data source. ID. It is structured as \"`project_id`,`name`\".",
|
||||
Computed: true,
|
||||
},
|
||||
"project_id": schema.StringAttribute{
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ type projectDataSource struct {
|
|||
client *ske.APIClient
|
||||
}
|
||||
|
||||
// Metadata returns the resource type name.
|
||||
// Metadata returns the data source type name.
|
||||
func (r *projectDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "_ske_project"
|
||||
}
|
||||
|
||||
// Configure adds the provider configured client to the resource.
|
||||
// Configure adds the provider configured client to the data source.
|
||||
func (r *projectDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
|
||||
// Prevent panic if the provider has not been configured.
|
||||
if req.ProviderData == nil {
|
||||
|
|
@ -71,12 +71,12 @@ func (r *projectDataSource) Configure(ctx context.Context, req datasource.Config
|
|||
tflog.Info(ctx, "SKE client configured")
|
||||
}
|
||||
|
||||
// Schema defines the schema for the resource.
|
||||
// Schema defines the schema for the data source.
|
||||
func (r *projectDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = schema.Schema{
|
||||
Attributes: map[string]schema.Attribute{
|
||||
"id": schema.StringAttribute{
|
||||
Description: "Terraform's internal resource ID. It is structured as \"`project_id`\".",
|
||||
Description: "Terraform's internal data source. ID. It is structured as \"`project_id`\".",
|
||||
Computed: true,
|
||||
},
|
||||
"project_id": schema.StringAttribute{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue