Skip to content

Commit

Permalink
Add duplicated doc keys
Browse files Browse the repository at this point in the history
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
  • Loading branch information
ulucinar committed Sep 13, 2022
1 parent 4bae257 commit 21f3383
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
10 changes: 0 additions & 10 deletions pkg/registry/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ func (r *Resource) scrapePrelude(doc *html.Node, preludeXPath string) error {
}

func (r *Resource) scrapeFieldDocs(doc *html.Node, fieldXPath string) {
conflictedFields := make(map[string]bool)
processed := make(map[*html.Node]struct{})
codeNodes := htmlquery.Find(doc, fieldXPath)
for _, n := range codeNodes {
Expand All @@ -248,17 +247,8 @@ func (r *Resource) scrapeFieldDocs(doc *html.Node, fieldXPath string) {
if r.ArgumentDocs == nil {
r.ArgumentDocs = make(map[string]string)
}
if r.ArgumentDocs[attrName] != "" && r.ArgumentDocs[attrName] != strings.TrimSpace(docStr) {
conflictedFields[attrName] = true
continue
}
r.ArgumentDocs[attrName] = strings.TrimSpace(docStr)
}

// Remove descriptions for repeating fields in the registry.
for cf := range conflictedFields {
delete(r.ArgumentDocs, cf)
}
}

func getRootPath(n *html.Node) string { // nolint: gocyclo
Expand Down
1 change: 1 addition & 0 deletions pkg/registry/testdata/aws/pm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ resources:
bucket: '- (Required, Forces new resource) The name of the bucket.'
expected_bucket_owner: '- (Optional, Forces new resource) The account ID of the expected bucket owner.'
grantee.email_address: '- (Optional) Email address of the grantee. See Regions and Endpoints for supported AWS regions where this argument can be specified.'
grantee.id: '- The bucket, expected_bucket_owner (if configured), and acl (if configured) separated by commas (,).'
grantee.type: '- (Required) Type of grantee. Valid values: CanonicalUser, AmazonCustomerByEmail, Group.'
grantee.uri: '- (Optional) URI of the grantee group.'
owner.display_name: '- (Optional) The display name of the owner.'
Expand Down
4 changes: 4 additions & 0 deletions pkg/registry/testdata/azure/pm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ resources:
default_node_pool.max_pods: '- (Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created.'
default_node_pool.min_count: '- (Required) The minimum number of nodes which should exist in this Node Pool. If specified this must be between 1 and 1000.'
default_node_pool.name: '- (Required) The name which should be used for the default Kubernetes Node Pool. Changing this forces a new resource to be created.'
default_node_pool.node_count: '- (Required) The number of nodes which should exist in this Node Pool. If specified this must be between 1 and 1000.'
default_node_pool.node_labels: '- (Optional) A map of Kubernetes labels which should be applied to nodes in the Default Node Pool.'
default_node_pool.node_public_ip_prefix_id: '- (Optional) Resource ID for the Public IP Addresses Prefix for the nodes in this Node Pool. enable_node_public_ip should be true. Changing this forces a new resource to be created.'
default_node_pool.only_critical_addons_enabled: '- (Optional) Enabling this option will taint default node pool with CriticalAddonsOnly=true:NoSchedule taint. Changing this forces a new resource to be created.'
Expand Down Expand Up @@ -290,6 +291,7 @@ resources:
sysctl_config.vm_vfs_cache_pressure: '- (Optional) The sysctl setting vm.vfs_cache_pressure. Must be between 0 and 100. Changing this forces a new resource to be created.'
tags: '- (Optional) A mapping of tags to assign to the resource.'
upgrade_settings.client_certificate: '- Base64 encoded public certificate used by clients to authenticate to the Kubernetes cluster.'
upgrade_settings.client_id: '- The Client ID of the user-defined Managed Identity used by the Secret Provider.'
upgrade_settings.client_key: '- Base64 encoded private key used by clients to authenticate to the Kubernetes cluster.'
upgrade_settings.cluster_ca_certificate: '- Base64 encoded public CA certificate used as the root of trust for the Kubernetes cluster.'
upgrade_settings.create: '- (Defaults to 90 minutes) Used when creating the Kubernetes Cluster.'
Expand All @@ -307,6 +309,7 @@ resources:
upgrade_settings.kube_config_raw: '- Raw Kubernetes config to be used by kubectl and other compatible tools.'
upgrade_settings.max_surge: '- (Required) The maximum number or percentage of nodes which will be added to the Node Pool size during an upgrade.'
upgrade_settings.node_resource_group: '- The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster.'
upgrade_settings.object_id: '- The Object ID of the user-defined Managed Identity used by the Secret Provider.'
upgrade_settings.oidc_issuer_url: '- The OIDC issuer URL that is associated with the cluster.'
upgrade_settings.oms_agent_identity: '- An oms_agent_identity block is exported. The exported attributes are defined below.'
upgrade_settings.password: '- A password or token used to authenticate to the Kubernetes cluster.'
Expand All @@ -317,6 +320,7 @@ resources:
upgrade_settings.secret_identity: '- An secret_identity block is exported. The exported attributes are defined below.'
upgrade_settings.tenant_id: '- The Tenant ID associated with this Managed Service Identity.'
upgrade_settings.update: '- (Defaults to 90 minutes) Used when updating the Kubernetes Cluster.'
upgrade_settings.user_assigned_identity_id: '- The ID of the User Assigned Identity used by the Secret Provider.'
upgrade_settings.username: '- A username used to authenticate to the Kubernetes cluster.'
windows_profile: '- (Optional) A windows_profile block as defined below.'
windows_profile.admin_password: '- (Required) The Admin Password for Windows VMs. Length must be between 14 and 123 characters.'
Expand Down
6 changes: 6 additions & 0 deletions pkg/registry/testdata/gcp/pm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,14 @@ resources:
maintenance_policy: |-
- (Optional) The maintenance policy to use for the cluster. Structure is
documented below.
maintenance_policy.daily_maintenance_window: |-
- Time window specified for daily maintenance operations.
Specify start_time in RFC3339 format "HH:MM”,
where HH : [00-23] and MM : [00-59] GMT. For example:
maintenance_policy.maintenance_exclusion: '- Exceptions to maintenance window. Non-emergency maintenance should not occur in these windows. A cluster can have up to three maintenance exclusions at a time Maintenance Window and Exclusions'
maintenance_policy.maintenance_exclusion.exclusion_options: '- (Optional) MaintenanceExclusionOptions provides maintenance exclusion related options.'
maintenance_policy.maintenance_exclusion.exclusion_options.scope: '- (Required) The scope of automatic upgrades to restrict in the exclusion window. One of: NO_UPGRADES | NO_MINOR_UPGRADES | NO_MINOR_OR_NODE_UPGRADES'
maintenance_policy.recurring_window: '- Time window for recurring maintenance operations.'
master_auth: |-
- (Optional) The authentication information for accessing the
Kubernetes master. Some values in this block are only returned by the API if
Expand Down

0 comments on commit 21f3383

Please sign in to comment.