diff --git a/Makefile b/Makefile index 2f799e6b6..a32513155 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,7 @@ endif manifests: yq controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd:maxDescLen=0,generateEmbeddedObjectMeta=false output:crd:artifacts:config=config/crd/bases $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd:maxDescLen=0,generateEmbeddedObjectMeta=false output:crd:artifacts:config=deploy/helm/grafana-operator/crds - $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=config/ + $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=config/crd-for-docs-generation yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].env[] | select (.name == "RELATED_IMAGE_GRAFANA")).value="$(GRAFANA_IMAGE):$(GRAFANA_VERSION)"' config/manager/manager.yaml # Sync role definitions to helm chart mkdir -p deploy/helm/grafana-operator/files @@ -105,13 +105,8 @@ manifests: yq controller-gen ## Generate WebhookConfiguration, ClusterRole and C cat config/rbac/role.yaml | yq -r 'del(.rules[] | select (.apiGroups | contains(["route.openshift.io"]) | not))' > deploy/helm/grafana-operator/files/rbac-openshift.yaml # Generate API reference documentation -api-docs: gen-crd-api-reference-docs kustomize - @{ \ - set -e ;\ - TMP_DIR=$$(mktemp -d) ; \ - $(KUSTOMIZE) build config/ -o $$TMP_DIR/crd-output.yaml ;\ - $(API_REF_GEN) crdoc --resources $$TMP_DIR/crd-output.yaml --output docs/docs/api.md --template hugo/templates/frontmatter-grafana-operator.tmpl ;\ - } +api-docs: manifests gen-crd-api-reference-docs + $(API_REF_GEN) crdoc --resources config/crd-for-docs-generation --output docs/docs/api.md --template hugo/templates/frontmatter-grafana-operator.tmpl .PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. diff --git a/config/grafana.integreatly.org_grafanaalertrulegroups.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanaalertrulegroups.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanaalertrulegroups.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanaalertrulegroups.yaml diff --git a/config/grafana.integreatly.org_grafanacontactpoints.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanacontactpoints.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanacontactpoints.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanacontactpoints.yaml diff --git a/config/grafana.integreatly.org_grafanadashboards.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanadashboards.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanadashboards.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanadashboards.yaml diff --git a/config/grafana.integreatly.org_grafanadatasources.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanadatasources.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanadatasources.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanadatasources.yaml diff --git a/config/grafana.integreatly.org_grafanafolders.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanafolders.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanafolders.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanafolders.yaml diff --git a/config/grafana.integreatly.org_grafanas.yaml b/config/crd-for-docs-generation/grafana.integreatly.org_grafanas.yaml similarity index 100% rename from config/grafana.integreatly.org_grafanas.yaml rename to config/crd-for-docs-generation/grafana.integreatly.org_grafanas.yaml diff --git a/config/kustomization.yaml b/config/kustomization.yaml deleted file mode 100644 index 0a15f5b05..000000000 --- a/config/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# This kustomization.yaml is not intended to be run by itself, -# It's only mean for documentation generation. -# If you want to install the operator CRD us `make install` and it will use the files under crd/base -resources: - - grafana.integreatly.org_grafanas.yaml - - grafana.integreatly.org_grafanadashboards.yaml - - grafana.integreatly.org_grafanadatasources.yaml - - grafana.integreatly.org_grafanafolders.yaml - - grafana.integreatly.org_grafanaalertrulegroups.yaml - - grafana.integreatly.org_grafanacontactpoints.yaml -#+kubebuilder:scaffold:crdkustomizeresource