Skip to content

Commit

Permalink
fix id
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-medvedev-codefresh committed May 30, 2024
1 parent cad7705 commit 32bec9d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion codefresh/data_account_gitops_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ func dataSourceAccountGitopsSettings() *schema.Resource {
Description: "This data source retrieves gitops settings for the active account",
Read: dataSourceAccountGitopsSettingsRead,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Description: "Account Id",
Computed: true,
},
"name": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -59,7 +64,6 @@ func mapDataAccountGitopsSettingsToResource(account *cfclient.GitopsActiveAccoun
return fmt.Errorf("cannot get gitops settings as account wasn't properly retrived")
}
d.SetId(account.ID)
d.Set("_id", account.ID)
d.Set("name", account.AccountName)
d.Set("admins", account.Admins)
d.Set("git_provider", account.GitProvider)
Expand Down
7 changes: 6 additions & 1 deletion codefresh/resource_account_gitops_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ func resourceAccountGitopsSettings() *schema.Resource {
// Delete not implemenented as gitops settings cannot be removed, only updated
Delete: resourceAccountGitopsSettingsDelete,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Description: "Account Id",
Computed: true,
},
"name": {
Type: schema.TypeString,
Description: "Account name for active account",
Expand Down Expand Up @@ -117,8 +122,8 @@ func mapAccountGitopsSettingsToResource(account *cfclient.GitopsActiveAccountInf
if account == nil || account.ID == "" {
return fmt.Errorf("cannot get gitops settings as account wasn't properly retrived")
}

d.SetId(account.ID)
d.Set("_id", account.ID)
d.Set("name", account.AccountName)
d.Set("git_provider", account.GitProvider)
d.Set("git_provider_api_url", account.GitApiUrl)
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/account_gitops_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This data source retrieves gitops settings for the active account
- `admins` (List of String)
- `git_provider` (String)
- `git_provider_api_url` (String)
- `id` (String) The ID of this resource.
- `id` (String) Account Id
- `name` (String)
- `shared_config_repository` (String)

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/account_gitops_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "codefresh_account_gitops_settings" "gitops-settings" {

### Read-Only

- `id` (String) The ID of this resource.
- `id` (String) Account Id
- `name` (String) Account name for active account

[!WARNING]
Expand Down

0 comments on commit 32bec9d

Please sign in to comment.