Skip to content

Commit

Permalink
WIP: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimuon committed Sep 8, 2022
1 parent 69d3670 commit 2dc8b86
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 6 deletions.
11 changes: 7 additions & 4 deletions ec/ecdatasource/deploymentsdatasource/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions ec/internal/planmodifier/default_from_env.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
17 changes: 17 additions & 0 deletions ec/internal/planmodifier/default_value.go
Original file line number Diff line number Diff line change
@@ -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

Expand Down
17 changes: 17 additions & 0 deletions ec/internal/validators/knownvalidator.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
17 changes: 17 additions & 0 deletions ec/internal/validators/urlvalidator.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2dc8b86

Please sign in to comment.