Skip to content

Commit 66b7c9f

Browse files
authored
Merge pull request kubernetes#6687 from abiogenesis-now/jyao/allow-glossary-prefix
[glossary] Add prepend option to glossary definition tag
2 parents 5cd52c3 + 805c447 commit 66b7c9f

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

_plugins/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This renders the definition of the glossary term inside a `<div>`, preserving Ma
2525
| --- | --- | --- |
2626
| `term_id` | N/A (Required) | The `id` of the glossary term whose definition will be used. (This `id` is the same as the filename of the term, i.e. `_data/glossary/<ID>.yml`.) |
2727
| `length` | "short" | Specifies which term definition should be used ("short" for the `short-definition`, "long" for `long-description`, "all" when both should be included). |
28+
| `prepend` | "Service Catalog is" | A prefix which can be attached in front of a term's short definition (which is one or more sentence fragments). |
2829

2930
#### (2) `glossary_tooltip` tag
3031

_plugins/glossary_tags.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ def include_snippet(context)
5555
class Definition < Base
5656
VALID_PARAM_NAMES = [
5757
:term_id,
58-
:length
58+
:length,
59+
:prepend,
5960
].freeze
6061

6162
def render(context)
62-
include_snippet(context)
63+
text = include_snippet(context)
64+
if @args[:prepend]
65+
text.sub(/<p>(.)/) { "<p>#{@args[:prepend]} #{$1.downcase}" }
66+
else
67+
text
68+
end
6369
end
6470
end
6571

docs/concepts/service-catalog/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ approvers:
55
---
66

77
{% capture overview %}
8-
{% glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is " %}
8+
{% glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" %}
99

1010
A *Service Broker*, as defined by the [Open Service Broker API spec](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md), is an endpoint for a set of Managed Services offered and maintained by a third-party, which could be a cloud provider such as AWS, GCP, or Azure.
1111
Some examples of *Managed Services* are Microsoft Azure Cloud Queue, Amazon Simple Queue Service, and Google Cloud Pub/Sub, but they can be any software offering that can be used by an application.
@@ -55,7 +55,7 @@ Upon creation, the Service Catalog controller will create a Kubernetes `Secret`
5555

5656
### Authentication
5757

58-
Service Catalog supports these methods of authentication:
58+
Service Catalog supports these methods of authentication:
5959

6060
* Basic (username/password)
6161
* [OAuth 2.0 Bearer Token](https://tools.ietf.org/html/rfc6750)
@@ -118,7 +118,7 @@ The following is a sequence diagram illustrating the steps involved in listing M
118118

119119
### Provisioning a new instance
120120

121-
A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can initiate the provisioning of a new instance by creating a `ServiceInstance` resource.
121+
A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can initiate the provisioning of a new instance by creating a `ServiceInstance` resource.
122122

123123
This is an example of a `ServiceInstance` resource:
124124

@@ -133,7 +133,7 @@ spec:
133133
clusterServiceClassExternalName: cloud-provider-service
134134
clusterServicePlanExternalName: service-plan-name
135135
#####
136-
# Additional parameters can be added here,
136+
# Additional parameters can be added here,
137137
# which may be used by the Service Broker.
138138
#####
139139
```
@@ -148,7 +148,7 @@ The following sequence diagram illustrates the steps involved in provisioning a
148148

149149
### Binding to a Managed Service
150150

151-
After a new instance has been provisioned, a {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} must bind to the Managed Service to get the connection credentials and service account details necessary for the application to use the service. This is done by creating a `ServiceBinding` resource.
151+
After a new instance has been provisioned, a {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} must bind to the Managed Service to get the connection credentials and service account details necessary for the application to use the service. This is done by creating a `ServiceBinding` resource.
152152

153153
The following is an example of a `ServiceBinding` resource:
154154

@@ -162,7 +162,7 @@ spec:
162162
instanceRef:
163163
name: cloud-queue-instance
164164
#####
165-
# Additional information can be added here, such as a secretName or
165+
# Additional information can be added here, such as a secretName or
166166
# service account parameters, which may be used by the Service Broker.
167167
#####
168168
```

docs/tasks/service-catalog/install-service-catalog-using-helm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ approvers:
55
---
66

77
{% capture overview %}
8-
{% glossary_definition term_id="service-catalog" length="long" %}
8+
{% glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" %}
99

1010
Use [Helm](https://helm.sh/) to install Service Catalog on your Kubernetes cluster. Up to date information on this process can be found at the [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog/blob/master/docs/install.md) repo.
1111

@@ -97,4 +97,4 @@ helm install svc-cat/catalog \
9797
{% endcapture %}
9898

9999

100-
{% include templates/task.md %}
100+
{% include templates/task.md %}

docs/tasks/service-catalog/install-service-catalog-using-sc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ approvers:
55
---
66

77
{% capture overview %}
8-
{% glossary_definition term_id="service-catalog" length="long" %}
8+
{% glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" %}
99

1010
Use the [Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-service-catalog#installation) tool to easily install or uninstall Service Catalog on your Kubernetes cluster. This CLI tool is installed as `sc` in your local environment.
1111

@@ -15,7 +15,7 @@ Use the [Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-s
1515
{% capture prerequisites %}
1616
* Understand the key concepts of [Service Catalog](/docs/concepts/service-catalog/).
1717
* Install [Go 1.6+](https://golang.org/dl/) and set the `GOPATH`.
18-
* Install the [cfssl](https://github.com/cloudflare/cfssl) tool needed for generating SSL artifacts.
18+
* Install the [cfssl](https://github.com/cloudflare/cfssl) tool needed for generating SSL artifacts.
1919
* Service Catalog requires Kubernetes version 1.7+.
2020
* [Install and setup kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) so that it is configured to connect to a Kubernetes v1.7+ cluster.
2121
* The kubectl user must be bound to the *cluster-admin* role for it to install Service Catalog. To ensure that this is true, run the following command:
@@ -44,11 +44,11 @@ First, verify that all dependencies have been installed. Run:
4444
sc check
4545
```
4646

47-
If the check is successful, it should return:
47+
If the check is successful, it should return:
4848

4949
```
5050
Dependency check passed. You are good to go.
51-
```
51+
```
5252

5353
Next, run the install command and specify the `storageclass` that you want to use for the backup:
5454

@@ -74,4 +74,4 @@ sc uninstall
7474
{% endcapture %}
7575

7676

77-
{% include templates/task.md %}
77+
{% include templates/task.md %}

0 commit comments

Comments
 (0)