Skip to content

Commit

Permalink
fix git credential null description issue (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
HuyPhanNguyen authored Aug 13, 2024
1 parent f11f6f9 commit c32f73f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions octopusdeploy_framework/schemas/gitCredential.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
datasourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
resourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
)

const (
Expand All @@ -16,21 +17,23 @@ func GetGitCredentialResourceSchema() resourceSchema.Schema {
return resourceSchema.Schema{
Description: "Manages a Git credential in Octopus Deploy.",
Attributes: map[string]resourceSchema.Attribute{
"id": util.ResourceString().Optional().Computed().Description("The unique ID for this resource.").Build(),
"space_id": util.ResourceString().Optional().Computed().Description("The space ID associated with this Git Credential.").Build(),
"id": util.ResourceString().Optional().Computed().PlanModifiers(stringplanmodifier.UseStateForUnknown()).Description("The unique ID for this resource.").Build(),
"space_id": util.ResourceString().Optional().Computed().PlanModifiers(stringplanmodifier.UseStateForUnknown()).Description("The space ID associated with this Git Credential.").Build(),
"name": util.ResourceString().Required().Description("The name of this Git Credential.").Build(),
"description": util.ResourceString().Optional().Description("The description of this Git Credential.").Build(),
"description": util.ResourceString().Optional().Computed().Default("").Description("The description of this Git Credential.").Build(),
"type": util.ResourceString().
Optional().
Description("The Git credential authentication type.").
Build(),
"username": util.ResourceString().
Required().
PlanModifiers(stringplanmodifier.UseStateForUnknown()).
Description("The username for the Git credential.").
Validators(stringvalidator.LengthAtLeast(1)).
Build(),
"password": util.ResourceString().
Required().
PlanModifiers(stringplanmodifier.UseStateForUnknown()).
Sensitive().
Description("The password for the Git credential.").
Validators(stringvalidator.LengthAtLeast(1)).
Expand Down

0 comments on commit c32f73f

Please sign in to comment.