diff --git a/ec/ecdatasource/deploymentsdatasource/datasource.go b/ec/ecdatasource/deploymentsdatasource/datasource.go index 0fbd64040..7f4b6b64c 100644 --- a/ec/ecdatasource/deploymentsdatasource/datasource.go +++ b/ec/ecdatasource/deploymentsdatasource/datasource.go @@ -20,13 +20,14 @@ package deploymentsdatasource import ( "context" "fmt" + "strconv" + "github.com/elastic/terraform-provider-ec/ec/internal" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "strconv" "github.com/elastic/cloud-sdk-go/pkg/api/deploymentapi" "github.com/elastic/cloud-sdk-go/pkg/models" @@ -37,10 +38,12 @@ var _ provider.DataSourceType = (*DataSourceType)(nil) type DataSourceType struct{} -func (s DataSourceType) NewDataSource(ctx context.Context, p provider.Provider) (datasource.DataSource, diag.Diagnostics) { +func (s DataSourceType) NewDataSource(ctx context.Context, in provider.Provider) (datasource.DataSource, diag.Diagnostics) { + p, diags := internal.ConvertProviderType(in) + return &deploymentsDataSource{ - p: p.(internal.Provider), - }, nil + p: p, + }, diags } var _ datasource.DataSource = (*deploymentsDataSource)(nil) diff --git a/ec/internal/planmodifier/default_from_env.go b/ec/internal/planmodifier/default_from_env.go index 04de4cc43..77b2fd3cc 100644 --- a/ec/internal/planmodifier/default_from_env.go +++ b/ec/internal/planmodifier/default_from_env.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package planmodifier import ( diff --git a/ec/internal/planmodifier/default_value.go b/ec/internal/planmodifier/default_value.go index 6f3b8e4b9..75ad85026 100644 --- a/ec/internal/planmodifier/default_value.go +++ b/ec/internal/planmodifier/default_value.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + // NOTE! copied from terraform-provider-tls package planmodifier diff --git a/ec/internal/validators/knownvalidator.go b/ec/internal/validators/knownvalidator.go index 82593e66c..129c93506 100644 --- a/ec/internal/validators/knownvalidator.go +++ b/ec/internal/validators/knownvalidator.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package validators import ( diff --git a/ec/internal/validators/urlvalidator.go b/ec/internal/validators/urlvalidator.go index a66f44d34..5dc7751ab 100644 --- a/ec/internal/validators/urlvalidator.go +++ b/ec/internal/validators/urlvalidator.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package validators import ( diff --git a/main.go b/main.go index dc07353c1..f265a1c85 100644 --- a/main.go +++ b/main.go @@ -22,8 +22,6 @@ import ( "flag" "log" - "github.com/hashicorp/terraform-plugin-framework/providerserver" - "github.com/elastic/terraform-provider-ec/ec" "github.com/hashicorp/terraform-plugin-framework/providerserver"