Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git credential null description issue #735

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading