mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 03:38:43 +00:00
make: Build scripts and target for admission webhook manifests
This commit is contained in:
parent
6ae8d9f276
commit
4af4a80dc4
2 changed files with 17 additions and 1 deletions
5
Makefile
5
Makefile
|
@ -195,7 +195,7 @@ tidy:
|
|||
cd scripts && go mod tidy -v -modfile=go.mod
|
||||
|
||||
.PHONY: generate
|
||||
generate: $(DEEPCOPY_TARGETS) generate-crds bundle.yaml example/mixin/alerts.yaml example/thanos/thanos.yaml generate-docs
|
||||
generate: $(DEEPCOPY_TARGETS) generate-crds bundle.yaml example/mixin/alerts.yaml example/thanos/thanos.yaml example/admission-webhook generate-docs
|
||||
|
||||
.PHONY: generate-crds
|
||||
generate-crds: $(CONTROLLER_GEN_BINARY) $(GOJSONTOYAML_BINARY) $(TYPES_V1_TARGET) $(TYPES_V1ALPHA1_TARGET)
|
||||
|
@ -232,6 +232,9 @@ $(RBAC_MANIFESTS): scripts/generate/vendor VERSION $(shell find jsonnet -type f)
|
|||
example/thanos/thanos.yaml: scripts/generate/vendor scripts/generate/thanos.jsonnet $(shell find jsonnet -type f)
|
||||
scripts/generate/build-thanos-example.sh
|
||||
|
||||
example/admission-webhook: scripts/generate/vendor scripts/generate/admission-webhook.jsonnet $(shell find jsonnet -type f)
|
||||
scripts/generate/build-admission-webhook-example.sh
|
||||
|
||||
FULLY_GENERATED_DOCS = Documentation/api.md Documentation/compatibility.md Documentation/operator.md
|
||||
TO_BE_EXTENDED_DOCS = $(filter-out $(FULLY_GENERATED_DOCS), $(shell find Documentation -type f))
|
||||
|
||||
|
|
13
scripts/generate/build-admission-webhook-example.sh
Executable file
13
scripts/generate/build-admission-webhook-example.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
# exit immediately when a command fails
|
||||
set -e
|
||||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
# error on unset variables
|
||||
set -u
|
||||
|
||||
AW=$(jsonnet -J scripts/generate/vendor scripts/generate/admission-webhook.jsonnet)
|
||||
echo "$AW" | jq -r 'keys[]' | while read -r file
|
||||
do
|
||||
echo "$AW" | jq -r ".[\"${file}\"]" | gojsontoyaml > "example/admission-webhook/${file}"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue