Skip to content

Commit fb571fb

Browse files
Merge pull request #2573 from machine424/doc2
MON-4383: feat(auto_docs_examples): adjust and add more examples
2 parents ffeace4 + 6a9716c commit fb571fb

28 files changed

+1108
-712
lines changed

Documentation/resources.adoc

Lines changed: 315 additions & 2 deletions
Large diffs are not rendered by default.

Documentation/resources.md

Lines changed: 278 additions & 26 deletions
Large diffs are not rendered by default.

assets/alertmanager/service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
* Port 9094 provides access to all the Alertmanager endpoints. Granting access requires binding a user to the `monitoring-alertmanager-view` role (for read-only operations) or `monitoring-alertmanager-edit` role in the `openshift-monitoring` project.
88
xx_omitted_before_deploy__test_file_name:openshift-monitoring_alertmanager-main_service_port_9094.yaml
99
* Port 9092 provides access to the Alertmanager endpoints restricted to a given project. Granting access requires binding a user to the `monitoring-rules-edit` cluster role or `monitoring-edit` cluster role in the project.
10+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_alertmanager-main_service_port_9092.yaml
1011
* Port 9097 provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
1112
service.beta.openshift.io/serving-cert-secret-name: alertmanager-main-tls
1213
labels:

assets/prometheus-k8s/service.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ metadata:
44
annotations:
55
openshift.io/description: |-
66
Expose the Prometheus web server within the cluster on the following ports:
7-
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
7+
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
8+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_prometheus-k8s_service_port_9091.yaml
89
* Port 9092 provides access to the `/metrics` and `/federate` endpoints only. This port is for internal use, and no other usage is guaranteed.
910
service.beta.openshift.io/serving-cert-secret-name: prometheus-k8s-tls
1011
labels:

assets/thanos-querier/service.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ metadata:
44
annotations:
55
openshift.io/description: |-
66
Expose the Thanos Querier web server within the cluster on the following ports:
7-
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
7+
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
8+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9091.yaml
89
* Port 9092 provides access to the `/api/v1/query`, `/api/v1/query_range/`, `/api/v1/labels`, `/api/v1/label/*/values`, and `/api/v1/series` endpoints restricted to a given project. Granting access requires binding a user to the `view` cluster role in the project.
10+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9092.yaml
911
* Port 9093 provides access to the `/api/v1/alerts`, and `/api/v1/rules` endpoints restricted to a given project. Granting access requires binding a user to the `monitoring-rules-edit` cluster role or `monitoring-edit` cluster role or `monitoring-rules-view` cluster role in the project.
12+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9093.yaml
1013
* Port 9094 provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
1114
service.beta.openshift.io/serving-cert-secret-name: thanos-querier-tls
1215
labels:

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/go-openapi/strfmt v0.23.0
1111
github.com/google/uuid v1.6.0
1212
github.com/imdario/mergo v0.3.16
13-
github.com/mattn/go-shellwords v1.0.12
1413
github.com/onsi/ginkgo/v2 v2.22.0
1514
github.com/onsi/gomega v1.36.1
1615
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250702172817-97309544869d

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec
242242
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
243243
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
244244
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
245-
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
246-
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
247245
github.com/miekg/dns v1.1.65 h1:0+tIPHzUW0GCge7IiK3guGP57VAw7hoPDfApjkMD1Fc=
248246
github.com/miekg/dns v1.1.65/go.mod h1:Dzw9769uoKVaLuODMDZz9M6ynFU6Em65csPuoi8G0ck=
249247
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=

hack/docgen/managed_resources.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,7 @@ func substitutePlaceholdersInDescription(desc, format string) (string, error) {
248248
} else {
249249
content = suite.StringMarkdown()
250250
}
251-
// TODO: remove once unnecessary
252-
if content != "" {
253-
lines = append(lines, content)
254-
}
251+
lines = append(lines, content)
255252
}
256253
if err := scanner.Err(); err != nil {
257254
return "", err

jsonnet/components/alertmanager.libsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ function(params)
7171
* Port %d provides access to all the Alertmanager endpoints. %s
7272
%s
7373
* Port %d provides access to the Alertmanager endpoints restricted to a given project. %s
74+
%s
7475
* Port %d provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
7576
||| % [
7677
$.service.spec.ports[0].port,
7778
requiredRoles([['monitoring-alertmanager-view', 'for read-only operations'], 'monitoring-alertmanager-edit'], 'openshift-monitoring'),
7879
testFilePlaceholder('openshift-monitoring', 'alertmanager-main', $.service.spec.ports[0].port),
7980
$.service.spec.ports[1].port,
8081
requiredClusterRoles(['monitoring-rules-edit', 'monitoring-edit'], false, ''),
82+
testFilePlaceholder('openshift-monitoring', 'alertmanager-main', $.service.spec.ports[1].port),
8183
$.service.spec.ports[2].port,
8284
],
8385
),

jsonnet/components/prometheus.libsonnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local generateSecret = import '../utils/generate-secret.libsonnet';
55
local prometheus = import 'github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus/components/prometheus.libsonnet';
66
local withDescription = (import '../utils/add-annotations.libsonnet').withDescription;
77
local requiredClusterRoles = (import '../utils/add-annotations.libsonnet').requiredClusterRoles;
8+
local testFilePlaceholder = (import '../utils/add-annotations.libsonnet').testFilePlaceholder;
89

910
function(params)
1011
local cfg = params;
@@ -103,10 +104,12 @@ function(params)
103104
|||
104105
Expose the Prometheus web server within the cluster on the following ports:
105106
* Port %d provides access to all the Prometheus endpoints. %s
107+
%s
106108
* Port %d provides access to the `/metrics` and `/federate` endpoints only. This port is for internal use, and no other usage is guaranteed.
107109
||| % [
108110
$.service.spec.ports[0].port,
109-
requiredClusterRoles(['cluster-monitoring-view'], true),
111+
requiredClusterRoles(['cluster-monitoring-view', 'cluster-monitoring-metrics-api'], false, 'openshift-monitoring'),
112+
testFilePlaceholder('openshift-monitoring', 'prometheus-k8s', $.service.spec.ports[0].port),
110113
$.service.spec.ports[1].port,
111114
],
112115
),

0 commit comments

Comments
 (0)