Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ jobs:
with:
version: v1.59.1 # Specify the golangci-lint version, so we are stable
args: --timeout 10m # Increase the timeout to 10 minutes

- name: Run make gen
run: |
make gen

- name: Ensure that make gen did not result in changes
uses: CatChen/check-git-status-action@v1
with:
fail-if-not-clean: true
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ gen: manifests generate format vet ## Generate code containing DeepCopy, DeepCop

.PHONY: manifests
manifests: controller-gen ## Generate CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=charts/qdrant-operator-crds/crds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two lines got expanded into 13 lines. I would suggest to move this logic into a script under hack directory, keeping the makefile easier to read and making the script testable.

cp charts/qdrant-operator-crds/crds/qdrant.io_qdrantversions.yaml charts/qdrant-operator-crds/crds-for-cluster-api/qdrant.io_qdrantversions.yaml
rm charts/qdrant-operator-crds/templates/management-crds/*.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to keep them in git repo at all, if everybody just consumes the published chart?

rm charts/qdrant-operator-crds/templates/region-crds/*.yaml
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=charts/qdrant-operator-crds/templates
mv charts/qdrant-operator-crds/templates/qdrant.io_qdrantversions.yaml charts/qdrant-operator-crds/templates/management-crds/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not for this PR, but we want to rename QdrantVersion to QdrantRelease

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, there is ticket for that.

mv charts/qdrant-operator-crds/templates/qdrant*.yaml charts/qdrant-operator-crds/templates/region-crds/
for file in charts/qdrant-operator-crds/templates/management-crds/*.yaml; do \
echo "{{ if .Values.includeManagementCRDs }}" | cat - $$file > temp && mv temp $$file; \
echo "{{ end }}" >> $$file; \
done
for file in charts/qdrant-operator-crds/templates/region-crds/*.yaml; do \
echo "{{ if .Values.includeRegionCRDs }}" | cat - $$file > temp && mv temp $$file; \
echo "{{ end }}" >> $$file; \
done
helm lint charts/qdrant-operator-crds

.PHONY: generate
generate: controller-gen crd-ref-docs ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
104 changes: 0 additions & 104 deletions charts/qdrant-operator-crds/crds/qdrant.io_qdrantversions.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeManagementCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -102,3 +103,4 @@ spec:
served: true
storage: true
subresources: {}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeRegionCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1727,3 +1728,4 @@ spec:
storage: true
subresources:
status: {}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeRegionCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -105,3 +106,4 @@ spec:
served: true
storage: true
subresources: {}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeRegionCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1096,3 +1097,4 @@ spec:
served: true
storage: true
subresources: {}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeRegionCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -111,3 +112,4 @@ spec:
served: true
storage: true
subresources: {}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.includeRegionCRDs }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -125,3 +126,4 @@ spec:
served: true
storage: true
subresources: {}
{{ end }}
4 changes: 4 additions & 0 deletions charts/qdrant-operator-crds/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Include management-crds in the deployment
includeManagementCRDs: false
# Include region-crds in the deployment
includeRegionCRDs: true