Skip to content

Commit

Permalink
prefer utility over custom for typename
Browse files Browse the repository at this point in the history
  • Loading branch information
benPearce1 committed Jul 29, 2024
1 parent 8c7f7c6 commit 2b7c78e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion octopusdeploy_framework/datasource_environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewEnvironmentsDataSource() datasource.DataSource {
}

func (*environmentDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {

Check warning on line 38 in octopusdeploy_framework/datasource_environments.go

View workflow job for this annotation

GitHub Actions / build

parameter 'req' seems to be unused, consider removing or renaming it as _
resp.TypeName = ProviderTypeName + "_environments"
resp.TypeName = util.GetTypeName("environments")
}

func (*environmentDataSource) Schema(_ context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
Expand Down
2 changes: 1 addition & 1 deletion octopusdeploy_framework/datasource_feeds.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewFeedsDataSource() datasource.DataSource {
}

func (*feedsDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {

Check warning on line 25 in octopusdeploy_framework/datasource_feeds.go

View workflow job for this annotation

GitHub Actions / build

parameter 'req' seems to be unused, consider removing or renaming it as _
resp.TypeName = ProviderTypeName + "_feeds"
resp.TypeName = util.GetTypeName("feeds")
}

func (e *feedsDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
Expand Down
2 changes: 1 addition & 1 deletion octopusdeploy_framework/datasource_project_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func getNestedGroupAttributes() map[string]attr.Type {
}

func (p *projectGroupsDataSource) Metadata(_ context.Context, _ datasource.MetadataRequest, resp *datasource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_project_groups"
resp.TypeName = util.GetTypeName("project_groups")
}

func (p *projectGroupsDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_artifactory_generic_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -23,7 +24,7 @@ func NewArtifactoryGenericFeedResource() resource.Resource {
}

func (r *artifactoryGenericFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {

Check warning on line 26 in octopusdeploy_framework/resource_artifactory_generic_feed.go

View workflow job for this annotation

GitHub Actions / build

parameter 'ctx' seems to be unused, consider removing or renaming it as _
resp.TypeName = ProviderTypeName + "_artifactory_generic_feed"
resp.TypeName = util.GetTypeName("artifactory_generic_feed")
}

func (r *artifactoryGenericFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/feeds"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -22,7 +23,7 @@ func NewAwsElasticContainerRegistryFeedResource() resource.Resource {
}

func (r *awsElasticContainerRegistryFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {

Check warning on line 25 in octopusdeploy_framework/resource_aws_elastic_container_registry.go

View workflow job for this annotation

GitHub Actions / build

parameter 'ctx' seems to be unused, consider removing or renaming it as _

Check warning on line 25 in octopusdeploy_framework/resource_aws_elastic_container_registry.go

View workflow job for this annotation

GitHub Actions / build

parameter 'req' seems to be unused, consider removing or renaming it as _
resp.TypeName = ProviderTypeName + "_aws_elastic_container_registry"
resp.TypeName = util.GetTypeName("aws_elastic_container_registry")
}

func (r *awsElasticContainerRegistryFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
2 changes: 1 addition & 1 deletion octopusdeploy_framework/resource_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewEnvironmentResource() resource.Resource {
}

func (r *environmentTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_environment"
resp.TypeName = util.GetTypeName("environment")
}

func (r *environmentTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_github_repository_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/feeds"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -22,7 +23,7 @@ func NewGitHubRepositoryFeedResource() resource.Resource {
}

func (r *githubRepositoryFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_github_repository_feed"
resp.TypeName = util.GetTypeName("github_repository_feed")
}

func (r *githubRepositoryFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_helm_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -23,7 +24,7 @@ func NewHelmFeedResource() resource.Resource {
}

func (r *helmFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {

Check warning on line 26 in octopusdeploy_framework/resource_helm_feed.go

View workflow job for this annotation

GitHub Actions / build

parameter 'ctx' seems to be unused, consider removing or renaming it as _

Check warning on line 26 in octopusdeploy_framework/resource_helm_feed.go

View workflow job for this annotation

GitHub Actions / build

parameter 'req' seems to be unused, consider removing or renaming it as _
resp.TypeName = ProviderTypeName + "_helm_feed"
resp.TypeName = util.GetTypeName("helm_feed")
}

func (r *helmFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_maven_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/feeds"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -22,7 +23,7 @@ func NewMavenFeedResource() resource.Resource {
}

func (r *mavenFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_maven_feed"
resp.TypeName = util.GetTypeName("maven_feed")
}

func (r *mavenFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_nuget_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/feeds"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
Expand All @@ -22,7 +23,7 @@ func NewNugetFeedResource() resource.Resource {
}

func (r *nugetFeedTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_nuget_feed"
resp.TypeName = util.GetTypeName("nuget_feed")
}

func (r *nugetFeedTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down
3 changes: 2 additions & 1 deletion octopusdeploy_framework/resource_project_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/projectgroups"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand All @@ -20,7 +21,7 @@ func NewProjectGroupResource() resource.Resource {
}

func (r *projectGroupTypeResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
resp.TypeName = ProviderTypeName + "_project_group"
resp.TypeName = util.GetTypeName("project_group")
}

func (r *projectGroupTypeResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
Expand Down

0 comments on commit 2b7c78e

Please sign in to comment.