Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create command for updating auto-generated docs and helm resources for CRD #3244

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,5 @@ Yash
yml
YOURNAME
yourregistry
gsub
helmcharts
4,040 changes: 2,020 additions & 2,020 deletions .github/scripts/.helm-tests/default/result.yaml

Large diffs are not rendered by default.

4,060 changes: 2,030 additions & 2,030 deletions .github/scripts/.helm-tests/lifecycle-only/result.yaml

Large diffs are not rendered by default.

4,026 changes: 2,013 additions & 2,013 deletions .github/scripts/.helm-tests/lifecycle-with-certs/result.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ data:
webhook:
port: 9443
---
# Source: keptn/charts/metricsOperator/templates/analysis-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analyses.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -60,6 +59,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analyses.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -398,11 +398,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisdefinition-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisdefinitions.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -416,6 +415,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisdefinitions.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1096,11 +1096,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisvaluetemplate-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisvaluetemplates.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1114,6 +1113,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisvaluetemplates.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1246,11 +1246,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetric-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetrics.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1264,6 +1263,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetrics.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1784,11 +1784,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetricsprovider-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetricsproviders.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1802,6 +1801,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetricsproviders.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down
20 changes: 10 additions & 10 deletions .github/scripts/.helm-tests/metrics-only/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ data:
webhook:
port: 9443
---
# Source: keptn/charts/metricsOperator/templates/analysis-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analyses.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -60,6 +59,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analyses.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -398,11 +398,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisdefinition-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisdefinitions.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -416,6 +415,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisdefinitions.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1096,11 +1096,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisvaluetemplate-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisvaluetemplates.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1114,6 +1113,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisvaluetemplates.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1246,11 +1246,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetric-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetrics.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1264,6 +1263,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetrics.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1784,11 +1784,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetricsprovider-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetricsproviders.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1802,6 +1801,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetricsproviders.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down
20 changes: 10 additions & 10 deletions .github/scripts/.helm-tests/metrics-with-certs/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ data:
webhook:
port: 9443
---
# Source: keptn/charts/metricsOperator/templates/analysis-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analyses.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -70,6 +69,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analyses.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -408,11 +408,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisdefinition-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisdefinitions.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -425,6 +424,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisdefinitions.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1105,11 +1105,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/analysisvaluetemplate-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: analysisvaluetemplates.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1122,6 +1121,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: analysisvaluetemplates.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1254,11 +1254,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetric-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetrics.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1271,6 +1270,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetrics.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down Expand Up @@ -1791,11 +1791,10 @@ spec:
subresources:
status: {}
---
# Source: keptn/charts/metricsOperator/templates/keptnmetricsprovider-crd.yaml
# Source: keptn/charts/metricsOperator/templates/metricsOperator-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: keptnmetricsproviders.metrics.keptn.sh
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
cert-manager.io/inject-ca-from: helmtests/keptn-certs
Expand All @@ -1808,6 +1807,7 @@ metadata:
app.kubernetes.io/name: metrics-operator
app.kubernetes.io/version: vmyversion
helm.sh/chart: metrics-operator-0.1.3
name: keptnmetricsproviders.metrics.keptn.sh
spec:
group: metrics.keptn.sh
names:
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,15 @@ lint: metrics-operator-lint
lint: certmanager-lint
lint: operator-lint
lint: scheduler-lint

.PHONY: update-operator-helmcharts-docs
update-operator-helmcharts-docs:
$(MAKE) -C lifecycle-operator update-helmcharts
./.github/scripts/generate-crd-docs/generate-crd-docs.sh
./.github/scripts/generate-helm-docs.sh

.PHONY: update-metrics-operator-helmcharts-docs
update-metrics-operator-helmcharts-docs:
$(MAKE) -C metrics-operator update-helmcharts
./.github/scripts/generate-crd-docs/generate-crd-docs.sh
./.github/scripts/generate-helm-docs.sh
12 changes: 12 additions & 0 deletions lifecycle-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,15 @@ push-local:
.PHONY: lint
lint:
${GOPATH}/bin/golangci-lint run --config ../.golangci.yml -v

##command to update chart/templates and docs
.PHONY: update-helmcharts
update-helmcharts: generate manifests
kustomize build config/crd > chart/templates/operator-crd.yaml
awk '/env: fake/ { print " cert-manager.io/inject-ca-from: '\''{{ .Release.Namespace }}/keptn-certs'\''"; print " {{- include \"common.annotations\" (dict \"context\" .) }}"; next } { print }' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml
awk '/putAnnotation: operator/ && !found { found=1; next } 1' chart/templates/operator-crd.yaml > chart/templates/temp && mv chart/templates/temp chart/templates/operator-crd.yaml
awk '/putAnnotation: operator/{print " {{- with .Values.global.caInjectionAnnotations }}"; print " {{- toYaml . | nindent 4 }}"; print " {{- end }}"; print " {{- include \"common.annotations\" ( dict \"context\" . ) }}"; next} 1' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml
awk '/putLabels: newLabel/{print "{{- include \"common.labels.standard\" (dict \"context\" .) | nindent 4 }}"; next} 1' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml
awk '{gsub("name: lifecycle-webhook-service", "name: '\''lifecycle-webhook-service'\''")}1' chart/templates/operator-crd.yaml > tmp_file && mv tmp_file chart/templates/operator-crd.yaml
awk '{gsub(/namespace: system/, "namespace: '\''{{ .Release.Namespace }}'\''")}1' chart/templates/operator-crd.yaml > tmp_file && mv tmp_file chart/templates/operator-crd.yaml

Loading
Loading