Skip to content

Commit 32bec9d

Browse files
fix id
1 parent cad7705 commit 32bec9d

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

codefresh/data_account_gitops_settings.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ func dataSourceAccountGitopsSettings() *schema.Resource {
1212
Description: "This data source retrieves gitops settings for the active account",
1313
Read: dataSourceAccountGitopsSettingsRead,
1414
Schema: map[string]*schema.Schema{
15+
"id": {
16+
Type: schema.TypeString,
17+
Description: "Account Id",
18+
Computed: true,
19+
},
1520
"name": {
1621
Type: schema.TypeString,
1722
Computed: true,
@@ -59,7 +64,6 @@ func mapDataAccountGitopsSettingsToResource(account *cfclient.GitopsActiveAccoun
5964
return fmt.Errorf("cannot get gitops settings as account wasn't properly retrived")
6065
}
6166
d.SetId(account.ID)
62-
d.Set("_id", account.ID)
6367
d.Set("name", account.AccountName)
6468
d.Set("admins", account.Admins)
6569
d.Set("git_provider", account.GitProvider)

codefresh/resource_account_gitops_settings.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ func resourceAccountGitopsSettings() *schema.Resource {
2323
// Delete not implemenented as gitops settings cannot be removed, only updated
2424
Delete: resourceAccountGitopsSettingsDelete,
2525
Schema: map[string]*schema.Schema{
26+
"id": {
27+
Type: schema.TypeString,
28+
Description: "Account Id",
29+
Computed: true,
30+
},
2631
"name": {
2732
Type: schema.TypeString,
2833
Description: "Account name for active account",
@@ -117,8 +122,8 @@ func mapAccountGitopsSettingsToResource(account *cfclient.GitopsActiveAccountInf
117122
if account == nil || account.ID == "" {
118123
return fmt.Errorf("cannot get gitops settings as account wasn't properly retrived")
119124
}
125+
120126
d.SetId(account.ID)
121-
d.Set("_id", account.ID)
122127
d.Set("name", account.AccountName)
123128
d.Set("git_provider", account.GitProvider)
124129
d.Set("git_provider_api_url", account.GitApiUrl)

docs/data-sources/account_gitops_settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This data source retrieves gitops settings for the active account
2020
- `admins` (List of String)
2121
- `git_provider` (String)
2222
- `git_provider_api_url` (String)
23-
- `id` (String) The ID of this resource.
23+
- `id` (String) Account Id
2424
- `name` (String)
2525
- `shared_config_repository` (String)
2626

docs/resources/account_gitops_settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ resource "codefresh_account_gitops_settings" "gitops-settings" {
3838

3939
### Read-Only
4040

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

4444
[!WARNING]

0 commit comments

Comments
 (0)