From 8873fa023ba6968792e5c9291eb80e3e8f4cfe4e Mon Sep 17 00:00:00 2001 From: ilia-medvedev-codefresh Date: Mon, 15 Jul 2024 09:46:59 +0300 Subject: [PATCH] patch - update docs: specify which resources require admin token (#149) --- codefresh/cfclient/user.go | 6 ++++-- codefresh/data_account.go | 2 +- codefresh/data_account_gitops_settings.go | 20 +++++++++---------- codefresh/data_idps.go | 2 +- codefresh/data_user.go | 2 +- codefresh/data_users.go | 2 +- codefresh/resource_account.go | 2 +- codefresh/resource_account_admins.go | 2 +- codefresh/resource_account_gitops_settings.go | 4 ++-- codefresh/resource_api_key.go | 1 + codefresh/resource_idp.go | 2 +- codefresh/resource_user.go | 2 +- docs/data-sources/account.md | 4 ++-- docs/data-sources/idps.md | 4 ++-- docs/data-sources/user.md | 4 ++-- docs/data-sources/users.md | 4 ++-- docs/resources/account.md | 4 ++-- docs/resources/account_admins.md | 4 ++-- docs/resources/account_gitops_settings.md | 2 +- docs/resources/api_key.md | 2 ++ docs/resources/idp.md | 4 ++-- docs/resources/user.md | 4 ++-- .../resources/account_gitops_settings.md.tmpl | 2 +- 23 files changed, 45 insertions(+), 40 deletions(-) diff --git a/codefresh/cfclient/user.go b/codefresh/cfclient/user.go index 37d4769..ec42b52 100644 --- a/codefresh/cfclient/user.go +++ b/codefresh/cfclient/user.go @@ -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), @@ -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 diff --git a/codefresh/data_account.go b/codefresh/data_account.go index a8875a8..0741b3d 100644 --- a/codefresh/data_account.go +++ b/codefresh/data_account.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations.", Read: dataSourceAccountRead, Schema: map[string]*schema.Schema{ "_id": { diff --git a/codefresh/data_account_gitops_settings.go b/codefresh/data_account_gitops_settings.go index 4245a58..7875786 100644 --- a/codefresh/data_account_gitops_settings.go +++ b/codefresh/data_account_gitops_settings.go @@ -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": { diff --git a/codefresh/data_idps.go b/codefresh/data_idps.go index 0d1ca68..675d2bf 100644 --- a/codefresh/data_idps.go +++ b/codefresh/data_idps.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations.", Read: dataSourceIdpRead, Schema: IdpSchema(), } diff --git a/codefresh/data_user.go b/codefresh/data_user.go index 732646c..ecdebbe 100644 --- a/codefresh/data_user.go +++ b/codefresh/data_user.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations.", Read: dataSourceUserRead, Schema: *UserSchema(), } diff --git a/codefresh/data_users.go b/codefresh/data_users.go index 5ae44de..be01692 100644 --- a/codefresh/data_users.go +++ b/codefresh/data_users.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations.", Read: dataSourceUsersRead, Schema: map[string]*schema.Schema{ "users": { diff --git a/codefresh/resource_account.go b/codefresh/resource_account.go index fd19b9b..f6a13af 100644 --- a/codefresh/resource_account.go +++ b/codefresh/resource_account.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. `, Create: resourceAccountCreate, Read: resourceAccountRead, diff --git a/codefresh/resource_account_admins.go b/codefresh/resource_account_admins.go index b5c777e..a806012 100644 --- a/codefresh/resource_account_admins.go +++ b/codefresh/resource_account_admins.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. `, Create: resourceAccountAdminsCreate, Read: resourceAccountAdminsRead, diff --git a/codefresh/resource_account_gitops_settings.go b/codefresh/resource_account_gitops_settings.go index 81dd852..49e9f8b 100644 --- a/codefresh/resource_account_gitops_settings.go +++ b/codefresh/resource_account_gitops_settings.go @@ -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, diff --git a/codefresh/resource_api_key.go b/codefresh/resource_api_key.go index 8b8935d..6a8e45f 100644 --- a/codefresh/resource_api_key.go +++ b/codefresh/resource_api_key.go @@ -14,6 +14,7 @@ func resourceApiKey() *schema.Resource { return &schema.Resource{ Description: ` Manages an API Key tied to an Account and a User. + Requires a Codefresh admin token and applies only to Codefresh on-premises installations. `, Create: resourceApiKeyCreate, Read: resourceApiKeyRead, diff --git a/codefresh/resource_idp.go b/codefresh/resource_idp.go index 49af78a..105a2e8 100644 --- a/codefresh/resource_idp.go +++ b/codefresh/resource_idp.go @@ -16,7 +16,7 @@ import ( func resourceIdp() *schema.Resource { return &schema.Resource{ - Description: "Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh", + Description: "Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations.", Create: resourceIDPCreate, Read: resourceIDPRead, Update: resourceIDPUpdate, diff --git a/codefresh/resource_user.go b/codefresh/resource_user.go index c73ecf0..80bbb33 100644 --- a/codefresh/resource_user.go +++ b/codefresh/resource_user.go @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations.", Create: resourceUsersCreate, Read: resourceUsersRead, Update: resourceUsersUpdate, diff --git a/docs/data-sources/account.md b/docs/data-sources/account.md index 0b53163..58ff11a 100644 --- a/docs/data-sources/account.md +++ b/docs/data-sources/account.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # 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 a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example Usage diff --git a/docs/data-sources/idps.md b/docs/data-sources/idps.md index 0008b85..a6db434 100644 --- a/docs/data-sources/idps.md +++ b/docs/data-sources/idps.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # 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 a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example Usage diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index 127a691..c520e21 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # codefresh_user (Data Source) -This data source retrieves a user by email. +This data source retrieves a user by email. Requires a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example usage diff --git a/docs/data-sources/users.md b/docs/data-sources/users.md index 4f28c6f..6ea3bb8 100644 --- a/docs/data-sources/users.md +++ b/docs/data-sources/users.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # codefresh_users (Data Source) -This data source retrieves all users in the system. +This data source retrieves all users in the system. Requires a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example usage diff --git a/docs/resources/account.md b/docs/resources/account.md index 0bbc685..eb07f91 100644 --- a/docs/resources/account.md +++ b/docs/resources/account.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # 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 a Codefresh admin token and applies only to Codefresh on-premises installations. See the [documentation](https://codefresh.io/docs/docs/administration/account-user-management/). diff --git a/docs/resources/account_admins.md b/docs/resources/account_admins.md index 207adca..f41fec5 100644 --- a/docs/resources/account_admins.md +++ b/docs/resources/account_admins.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # 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 a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example usage diff --git a/docs/resources/account_gitops_settings.md b/docs/resources/account_gitops_settings.md index b8be9f7..e522b5d 100644 --- a/docs/resources/account_gitops_settings.md +++ b/docs/resources/account_gitops_settings.md @@ -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. diff --git a/docs/resources/api_key.md b/docs/resources/api_key.md index 48fab68..276cb1e 100644 --- a/docs/resources/api_key.md +++ b/docs/resources/api_key.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # codefresh_api_key (Resource) Manages an API Key tied to an Account and a User. + Requires a Codefresh admin token and applies only to Codefresh on-premises installations. 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. diff --git a/docs/resources/idp.md b/docs/resources/idp.md index b05d1e5..275b822 100644 --- a/docs/resources/idp.md +++ b/docs/resources/idp.md @@ -2,12 +2,12 @@ page_title: "codefresh_idp Resource - terraform-provider-codefresh" subcategory: "" description: |- - Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh + Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations. --- # codefresh_idp (Resource) -Codefresh global level identity provider. Requires Codefresh admin token, hence is relevant only for on-prem deployments of Codefresh +Codefresh global level identity provider. Requires a Codefresh admin token and applies only to Codefresh on-premises installations. ## Example usage ```hcl diff --git a/docs/resources/user.md b/docs/resources/user.md index bbb2e1b..e1d5633 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -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 a Codefresh admin token and applies only to Codefresh on-premises installations. --- # codefresh_user (Resource) -This resource is used to manage a Codefresh user. +This resource is used to manage a Codefresh user. Requires a Codefresh admin token and applies only to Codefresh on-premises installations. diff --git a/templates/resources/account_gitops_settings.md.tmpl b/templates/resources/account_gitops_settings.md.tmpl index 1966bbf..c284841 100644 --- a/templates/resources/account_gitops_settings.md.tmpl +++ b/templates/resources/account_gitops_settings.md.tmpl @@ -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.