Skip to content

Commit 8873fa0

Browse files
patch - update docs: specify which resources require admin token (#149)
1 parent 205d0ec commit 8873fa0

23 files changed

+45
-40
lines changed

codefresh/cfclient/user.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ func (client *Client) GetAllUsers() (*[]User, error) {
228228
var allUsers []User
229229

230230
for !bIsDone {
231-
var userPaginatedResp struct{Docs []User `json:"docs"`}
231+
var userPaginatedResp struct {
232+
Docs []User `json:"docs"`
233+
}
232234

233235
opts := RequestOptions{
234236
Path: fmt.Sprintf("/admin/user?limit=%d&page=%d", limitPerQuery, nPageIndex),
@@ -248,7 +250,7 @@ func (client *Client) GetAllUsers() (*[]User, error) {
248250
}
249251

250252
if len(userPaginatedResp.Docs) > 0 {
251-
allUsers = append(allUsers,userPaginatedResp.Docs...)
253+
allUsers = append(allUsers, userPaginatedResp.Docs...)
252254
nPageIndex++
253255
} else {
254256
bIsDone = true

codefresh/data_account.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func dataSourceAccount() *schema.Resource {
1111
return &schema.Resource{
12-
Description: "This data source retrieves an account by _id or name.",
12+
Description: "This data source retrieves an account by _id or name. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
1313
Read: dataSourceAccountRead,
1414
Schema: map[string]*schema.Schema{
1515
"_id": {

codefresh/data_account_gitops_settings.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ func dataSourceAccountGitopsSettings() *schema.Resource {
1313
Read: dataSourceAccountGitopsSettingsRead,
1414
Schema: map[string]*schema.Schema{
1515
"id": {
16-
Type: schema.TypeString,
16+
Type: schema.TypeString,
1717
Description: "Account Id",
18-
Computed: true,
18+
Computed: true,
1919
},
2020
"name": {
21-
Type: schema.TypeString,
22-
Computed: true,
21+
Type: schema.TypeString,
22+
Computed: true,
2323
Description: "Account name for active account",
2424
},
2525
"git_provider": {
26-
Type: schema.TypeString,
27-
Computed: true,
26+
Type: schema.TypeString,
27+
Computed: true,
2828
Description: "Git provider name",
2929
},
3030
"git_provider_api_url": {
31-
Type: schema.TypeString,
32-
Computed: true,
31+
Type: schema.TypeString,
32+
Computed: true,
3333
Description: "Git provider API url",
3434
},
3535
"shared_config_repository": {
36-
Type: schema.TypeString,
37-
Computed: true,
36+
Type: schema.TypeString,
37+
Computed: true,
3838
Description: "Shared config repository url",
3939
},
4040
"admins": {

codefresh/data_idps.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func dataSourceIdps() *schema.Resource {
1212
return &schema.Resource{
13-
Description: "This data source retrieves all Identity Providers (IdPs) in the system.",
13+
Description: "This data source retrieves all Identity Providers (IdPs) in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
1414
Read: dataSourceIdpRead,
1515
Schema: IdpSchema(),
1616
}

codefresh/data_user.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func dataSourceUser() *schema.Resource {
1212
return &schema.Resource{
13-
Description: "This data source retrieves a user by email.",
13+
Description: "This data source retrieves a user by email. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
1414
Read: dataSourceUserRead,
1515
Schema: *UserSchema(),
1616
}

codefresh/data_users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func dataSourceUsers() *schema.Resource {
1111
return &schema.Resource{
12-
Description: "This data source retrieves all users in the system.",
12+
Description: "This data source retrieves all users in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
1313
Read: dataSourceUsersRead,
1414
Schema: map[string]*schema.Schema{
1515
"users": {

codefresh/resource_account.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
func resourceAccount() *schema.Resource {
99
return &schema.Resource{
1010
Description: `
11-
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
11+
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1212
`,
1313
Create: resourceAccountCreate,
1414
Read: resourceAccountRead,

codefresh/resource_account_admins.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
func resourceAccountAdmins() *schema.Resource {
1010
return &schema.Resource{
1111
Description: `
12-
Use this resource to set a list of admins for any account.
12+
Use this resource to set a list of admins for any account. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1313
`,
1414
Create: resourceAccountAdminsCreate,
1515
Read: resourceAccountAdminsRead,

codefresh/resource_account_gitops_settings.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func resourceAccountGitopsSettings() *schema.Resource {
2424
Delete: resourceAccountGitopsSettingsDelete,
2525
Schema: map[string]*schema.Schema{
2626
"id": {
27-
Type: schema.TypeString,
27+
Type: schema.TypeString,
2828
Description: "Account Id",
29-
Computed: true,
29+
Computed: true,
3030
},
3131
"name": {
3232
Type: schema.TypeString,

codefresh/resource_api_key.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func resourceApiKey() *schema.Resource {
1414
return &schema.Resource{
1515
Description: `
1616
Manages an API Key tied to an Account and a User.
17+
Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1718
`,
1819
Create: resourceApiKeyCreate,
1920
Read: resourceApiKeyRead,

codefresh/resource_idp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
func resourceIdp() *schema.Resource {
1818
return &schema.Resource{
19-
Description: "Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh",
19+
Description: "Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
2020
Create: resourceIDPCreate,
2121
Read: resourceIDPRead,
2222
Update: resourceIDPUpdate,

codefresh/resource_user.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
func resourceUser() *schema.Resource {
1313
return &schema.Resource{
14-
Description: "This resource is used to manage a Codefresh user.",
14+
Description: "This resource is used to manage a Codefresh user. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.",
1515
Create: resourceUsersCreate,
1616
Read: resourceUsersRead,
1717
Update: resourceUsersUpdate,

docs/data-sources/account.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_account Data Source - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This data source retrieves an account by _id or name.
5+
This data source retrieves an account by _id or name. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_account (Data Source)
99

10-
This data source retrieves an account by _id or name.
10+
This data source retrieves an account by _id or name. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example Usage
1313

docs/data-sources/idps.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_idps Data Source - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This data source retrieves all Identity Providers (IdPs) in the system.
5+
This data source retrieves all Identity Providers (IdPs) in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_idps (Data Source)
99

10-
This data source retrieves all Identity Providers (IdPs) in the system.
10+
This data source retrieves all Identity Providers (IdPs) in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example Usage
1313

docs/data-sources/user.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_user Data Source - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This data source retrieves a user by email.
5+
This data source retrieves a user by email. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_user (Data Source)
99

10-
This data source retrieves a user by email.
10+
This data source retrieves a user by email. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example usage
1313

docs/data-sources/users.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_users Data Source - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This data source retrieves all users in the system.
5+
This data source retrieves all users in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_users (Data Source)
99

10-
This data source retrieves all users in the system.
10+
This data source retrieves all users in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example usage
1313

docs/resources/account.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_account Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
5+
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_account (Resource)
99

10-
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
10+
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
See the [documentation](https://codefresh.io/docs/docs/administration/account-user-management/).
1313

docs/resources/account_admins.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_account_admins Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
Use this resource to set a list of admins for any account.
5+
Use this resource to set a list of admins for any account. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_account_admins (Resource)
99

10-
Use this resource to set a list of admins for any account.
10+
Use this resource to set a list of admins for any account. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example usage
1313

docs/resources/account_gitops_settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ resource "codefresh_account_gitops_settings" "gitops-settings" {
4141
- `id` (String) Account Id
4242
- `name` (String) Account name for active account
4343

44-
[!WARNING]
44+
~>
4545
Once internal config repository is cloned successfully by one or more runtimes it can no longer be changed and all attempted updates will fail.
4646
If you need to change the repository please contact Codefresh support.
4747

docs/resources/api_key.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ page_title: "codefresh_api_key Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
55
Manages an API Key tied to an Account and a User.
6+
Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
67
---
78

89
# codefresh_api_key (Resource)
910

1011
Manages an API Key tied to an Account and a User.
12+
Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1113

1214
terraform-provider-codefresh itself uses an API key, passed as provider's attribute, but it's possible to use that API Key to generate a new one.
1315
This resource requires Codefresh system admin permissions, hence is relevant for on-prem deployments of Codefresh only.

docs/resources/idp.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_idp Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh
5+
Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_idp (Resource)
99

10-
Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh
10+
Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212
## Example usage
1313
```hcl

docs/resources/user.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "codefresh_user Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This resource is used to manage a Codefresh user.
5+
This resource is used to manage a Codefresh user. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
66
---
77

88
# codefresh_user (Resource)
99

10-
This resource is used to manage a Codefresh user.
10+
This resource is used to manage a Codefresh user. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.
1111

1212

1313

templates/resources/account_gitops_settings.md.tmpl

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

2727
{{ .SchemaMarkdown | trimspace }}
2828

29-
[!WARNING]
29+
~>
3030
Once internal config repository is cloned successfully by one or more runtimes it can no longer be changed and all attempted updates will fail.
3131
If you need to change the repository please contact Codefresh support.
3232

0 commit comments

Comments
 (0)