Skip to content

Commit

Permalink
manifests: Rename "cluster_monitoring_operator" -> "cluster-monitorin…
Browse files Browse the repository at this point in the history
…g-operator"

The regular expression for the component portion is [1]:

  [a-z0-9\-]+

or [2]:

  [a-zA-Z0-9]+(-[a-zA-Z0-9]+)*?)

Either way, it cannot include underscores, so manifests like
0000_50_cluster_monitoring_operator_01-namespace.yaml end up in the
'cluster' component.  With this change, they will end up in the
'cluster-monitoring-operator' component.

The outgoing, underscore form landed in 9fd35c2 (manifests: prefix
manifests used by CVO with a 0000_xx_NAME prefix, 2019-06-25, #388).

Generated with:

  $ rename cluster_monitoring_operator cluster-monitoring-operator manifests/*.yaml
  $ sed -i 's/cluster_monitoring_operator/cluster-monitoring-operator/g' Documentation/data-collection.md Makefile README.md hack/build-jsonnet.sh hack/build-jsonnet.sh hack/local-cmo.sh hack/telemeter_query.go

[1]: https://github.com/openshift/cluster-version-operator/blob/71aef74480d199fe96a590f2f1e4e8056a9cb687/docs/dev/operators.md#what-is-the-order-that-resources-get-createdupdated-in
[2]: https://github.com/openshift/cluster-version-operator/blob/71aef74480d199fe96a590f2f1e4e8056a9cb687/pkg/payload/task_graph.go#L21
  • Loading branch information
wking committed Aug 17, 2020
1 parent 9d45dec commit 886d998
Show file tree
Hide file tree
Showing 20 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Documentation/data-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Red Hat values our customer experience and privacy. It is important to us that o

For the OpenShift 4 Developer Preview we will be sending back these exact attributes based on your cluster ID and pull secret from Red Hat:

[embedmd]:# (../manifests/0000_50_cluster_monitoring_operator_04-config.yaml)
[embedmd]:# (../manifests/0000_50_cluster-monitoring-operator_04-config.yaml)
```yaml
apiVersion: v1
data:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ vendor:
go mod verify

.PHONY: generate
generate: pkg/manifests/bindata.go manifests/0000_50_cluster_monitoring_operator_02-role.yaml docs
generate: pkg/manifests/bindata.go manifests/0000_50_cluster-monitoring-operator_02-role.yaml docs

.PHONY: generate-in-docker
generate-in-docker:
Expand All @@ -102,14 +102,14 @@ pkg/manifests/bindata.go: $(GOBINDATA_BIN) $(ASSETS)
$(GOBINDATA_BIN) -mode 420 -modtime 1 -pkg manifests -o $@ assets/...

# Merge cluster roles
manifests/0000_50_cluster_monitoring_operator_02-role.yaml: hack/merge_cluster_roles.py hack/cluster-monitoring-operator-role.yaml.in $(ASSETS)
manifests/0000_50_cluster-monitoring-operator_02-role.yaml: hack/merge_cluster_roles.py hack/cluster-monitoring-operator-role.yaml.in $(ASSETS)
python2 hack/merge_cluster_roles.py hack/cluster-monitoring-operator-role.yaml.in `find assets | grep role | grep -v "role-binding" | sort` > $@

.PHONY: docs
docs: $(EMBEDMD_BIN) Documentation/telemeter_query
$(EMBEDMD_BIN) -w `find Documentation -name "*.md"`

Documentation/telemeter_query: manifests/0000_50_cluster_monitoring_operator_04-config.yaml hack/telemeter_query.go
Documentation/telemeter_query: manifests/0000_50_cluster-monitoring-operator_04-config.yaml hack/telemeter_query.go
go generate ./hack/telemeter_query.go > Documentation/telemeter_query

##############
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Metrics are collected from the following components:

## Adding new metrics to be sent via telemetry

To add new metrics to be sent via telemetry, simply add a selector that matches the time-series to be sent in [manifests/0000_50_cluster_monitoring_operator_04-config.yaml](manifests/0000_50_cluster_monitoring_operator_04-config.yaml).
To add new metrics to be sent via telemetry, simply add a selector that matches the time-series to be sent in [manifests/0000_50_cluster-monitoring-operator_04-config.yaml](manifests/0000_50_cluster-monitoring-operator_04-config.yaml).

Documentation on the data sent can be found in the [data collection documentation](Documentation/data-collection.md).

Expand Down
4 changes: 2 additions & 2 deletions hack/build-jsonnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ done

# shellcheck disable=SC1003
# Produce dashboard definitions in format understandable by CVO (it doesn't accept ConfigMapList)
grep -E -v '^apiVersion: v1|^items:|^kind: ConfigMapList' "${prefix}/grafana/console-dashboard-definitions.yaml" | sed 's/^\ \ //g;s/- apiVersion: v1/---\'$'\n''apiVersion: v1/g' > "manifests/0000_90_cluster_monitoring_operator_01-dashboards.yaml"
grep -E -v '^apiVersion: v1|^items:|^kind: ConfigMapList' "${prefix}/grafana/console-dashboard-definitions.yaml" | sed 's/^\ \ //g;s/- apiVersion: v1/---\'$'\n''apiVersion: v1/g' > "manifests/0000_90_cluster-monitoring-operator_01-dashboards.yaml"
rm -f "${prefix}/grafana/console-dashboard-definitions.yaml"

grep -H 'kind: CustomResourceDefinition' assets/prometheus-operator/* | cut -d: -f1 | while IFS= read -r f; do
mv "$f" "manifests/0000_50_cluster_monitoring_operator_00_$(basename "$f")"
mv "$f" "manifests/0000_50_cluster-monitoring-operator_00_$(basename "$f")"
done
2 changes: 1 addition & 1 deletion hack/local-cmo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubectl patch clusterversion/version --type=json -p="[{\"op\": \"add\", \"path\"
kubectl -n openshift-monitoring scale --replicas=0 deployment/cluster-monitoring-operator

# shellcheck disable=SC2002
cat manifests/0000_50_cluster_monitoring_operator_04-config.yaml | gojsontoyaml -yamltojson | jq -r '.data["metrics.yaml"]' > /tmp/telemetry-config.yaml
cat manifests/0000_50_cluster-monitoring-operator_04-config.yaml | gojsontoyaml -yamltojson | jq -r '.data["metrics.yaml"]' > /tmp/telemetry-config.yaml

# shellcheck disable=SC2086
./operator ${IMAGES} -telemetry-config /tmp/telemetry-config.yaml -kubeconfig "${KUBECONFIG}" -namespace=openshift-monitoring -configmap=cluster-monitoring-config -logtostderr=true -v=4 2>&1 | tee operator.log
2 changes: 1 addition & 1 deletion hack/telemeter_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ func main() {
fmt.Println(s)
}

//go:generate go run -mod=vendor telemeter_query.go ../manifests/0000_50_cluster_monitoring_operator_04-config.yaml
//go:generate go run -mod=vendor telemeter_query.go ../manifests/0000_50_cluster-monitoring-operator_04-config.yaml

0 comments on commit 886d998

Please sign in to comment.