Skip to content

patch - update docs: specify which resources require admin token #149

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

Merged
merged 4 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 4 additions & 2 deletions codefresh/cfclient/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ func (client *Client) GetAllUsers() (*[]User, error) {
var allUsers []User

for !bIsDone {
var userPaginatedResp struct{Docs []User `json:"docs"`}
var userPaginatedResp struct {
Docs []User `json:"docs"`
}

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

if len(userPaginatedResp.Docs) > 0 {
allUsers = append(allUsers,userPaginatedResp.Docs...)
allUsers = append(allUsers, userPaginatedResp.Docs...)
nPageIndex++
} else {
bIsDone = true
Expand Down
2 changes: 1 addition & 1 deletion codefresh/data_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func dataSourceAccount() *schema.Resource {
return &schema.Resource{
Description: "This data source retrieves an account by _id or name.",
Description: "This data source retrieves an account by _id or name. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.",
Read: dataSourceAccountRead,
Schema: map[string]*schema.Schema{
"_id": {
Expand Down
20 changes: 10 additions & 10 deletions codefresh/data_account_gitops_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ func dataSourceAccountGitopsSettings() *schema.Resource {
Read: dataSourceAccountGitopsSettingsRead,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Type: schema.TypeString,
Description: "Account Id",
Computed: true,
Computed: true,
},
"name": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Account name for active account",
},
"git_provider": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Git provider name",
},
"git_provider_api_url": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Git provider API url",
},
"shared_config_repository": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Computed: true,
Description: "Shared config repository url",
},
"admins": {
Expand Down
2 changes: 1 addition & 1 deletion codefresh/data_idps.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func dataSourceIdps() *schema.Resource {
return &schema.Resource{
Description: "This data source retrieves all Identity Providers (IdPs) in the system.",
Description: "This data source retrieves all Identity Providers (IdPs) in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.",
Read: dataSourceIdpRead,
Schema: IdpSchema(),
}
Expand Down
2 changes: 1 addition & 1 deletion codefresh/data_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func dataSourceUser() *schema.Resource {
return &schema.Resource{
Description: "This data source retrieves a user by email.",
Description: "This data source retrieves a user by email. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.",
Read: dataSourceUserRead,
Schema: *UserSchema(),
}
Expand Down
2 changes: 1 addition & 1 deletion codefresh/data_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func dataSourceUsers() *schema.Resource {
return &schema.Resource{
Description: "This data source retrieves all users in the system.",
Description: "This data source retrieves all users in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.",
Read: dataSourceUsersRead,
Schema: map[string]*schema.Schema{
"users": {
Expand Down
2 changes: 1 addition & 1 deletion codefresh/resource_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
func resourceAccount() *schema.Resource {
return &schema.Resource{
Description: `
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
`,
Create: resourceAccountCreate,
Read: resourceAccountRead,
Expand Down
2 changes: 1 addition & 1 deletion codefresh/resource_account_admins.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func resourceAccountAdmins() *schema.Resource {
return &schema.Resource{
Description: `
Use this resource to set a list of admins for any account.
Use this resource to set a list of admins for any account. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
`,
Create: resourceAccountAdminsCreate,
Read: resourceAccountAdminsRead,
Expand Down
4 changes: 2 additions & 2 deletions codefresh/resource_account_gitops_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func resourceAccountGitopsSettings() *schema.Resource {
Delete: resourceAccountGitopsSettingsDelete,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Type: schema.TypeString,
Description: "Account Id",
Computed: true,
Computed: true,
},
"name": {
Type: schema.TypeString,
Expand Down
1 change: 1 addition & 0 deletions codefresh/resource_api_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func resourceApiKey() *schema.Resource {
return &schema.Resource{
Description: `
Manages an API Key tied to an Account and a User.
Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
`,
Create: resourceApiKeyCreate,
Read: resourceApiKeyRead,
Expand Down
2 changes: 1 addition & 1 deletion codefresh/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func resourceUser() *schema.Resource {
return &schema.Resource{
Description: "This resource is used to manage a Codefresh user.",
Description: "This resource is used to manage a Codefresh user. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.",
Create: resourceUsersCreate,
Read: resourceUsersRead,
Update: resourceUsersUpdate,
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_account Data Source - terraform-provider-codefresh"
subcategory: ""
description: |-
This data source retrieves an account by _id or name.
This data source retrieves an account by _id or name. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_account (Data Source)

This data source retrieves an account by _id or name.
This data source retrieves an account by _id or name. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

## Example Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/idps.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_idps Data Source - terraform-provider-codefresh"
subcategory: ""
description: |-
This data source retrieves all Identity Providers (IdPs) in the system.
This data source retrieves all Identity Providers (IdPs) in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_idps (Data Source)

This data source retrieves all Identity Providers (IdPs) in the system.
This data source retrieves all Identity Providers (IdPs) in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

## Example Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_user Data Source - terraform-provider-codefresh"
subcategory: ""
description: |-
This data source retrieves a user by email.
This data source retrieves a user by email. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_user (Data Source)

This data source retrieves a user by email.
This data source retrieves a user by email. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

## Example usage

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_users Data Source - terraform-provider-codefresh"
subcategory: ""
description: |-
This data source retrieves all users in the system.
This data source retrieves all users in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_users (Data Source)

This data source retrieves all users in the system.
This data source retrieves all users in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

## Example usage

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_account Resource - terraform-provider-codefresh"
subcategory: ""
description: |-
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_account (Resource)

By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

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

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/account_admins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_account_admins Resource - terraform-provider-codefresh"
subcategory: ""
description: |-
Use this resource to set a list of admins for any account.
Use this resource to set a list of admins for any account. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_account_admins (Resource)

Use this resource to set a list of admins for any account.
Use this resource to set a list of admins for any account. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

## Example usage

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 @@ -41,7 +41,7 @@ resource "codefresh_account_gitops_settings" "gitops-settings" {
- `id` (String) Account Id
- `name` (String) Account name for active account

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

Expand Down
2 changes: 2 additions & 0 deletions docs/resources/api_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ page_title: "codefresh_api_key Resource - terraform-provider-codefresh"
subcategory: ""
description: |-
Manages an API Key tied to an Account and a User.
Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_api_key (Resource)

Manages an API Key tied to an Account and a User.
Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.

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.
This resource requires Codefresh system admin permissions, hence is relevant for on-prem deployments of Codefresh only.
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "codefresh_user Resource - terraform-provider-codefresh"
subcategory: ""
description: |-
This resource is used to manage a Codefresh user.
This resource is used to manage a Codefresh user. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
---

# codefresh_user (Resource)

This resource is used to manage a Codefresh user.
This resource is used to manage a Codefresh user. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.



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

{{ .SchemaMarkdown | trimspace }}

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

Expand Down
Loading