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

Add v1alpha1 back to registered schemes + fix YQ issues #475

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Fix yq version not pinned/downloaded
jotak committed Oct 25, 2023
commit f4d6d3d3b510c1c48146062a818ad99cd822d3a2
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -241,6 +241,20 @@ ifeq (,$(shell which $(OPSDK) 2>/dev/null))
}
endif

.PHONY: yq
YQ = ./bin/yq
YQ: ## Download yq locally if necessary.
ifeq (,$(shell which $(YQ) 2>/dev/null))
@{ \
echo "### Downloading yq"; \
set -e ;\
mkdir -p $(dir $(YQ)) ;\
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
curl -sSLo $(YQ) https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_$${OS}_$${ARCH} ;\
chmod +x $(YQ) ;\
}
endif

##@ Code / files generation
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
@@ -261,7 +275,11 @@ generate-go-conversions: $(CONVERSION_GEN) ## Run all generate-go-conversions
$(CONVERSION_GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

generate: gencode manifests doc generate-go-conversions ## Run all code/file generators
generate: YQ gencode manifests doc generate-go-conversions ## Run all code/file generators
cat ./config/crd/bases/flows.netobserv.io_flowcollectors.yaml \
| $(YQ) eval-all \
'(.spec.versions.[]|select(.name != "v1beta2").storage) = false,(.spec.versions.[]|select(.name == "v1beta2").storage) = true' \
> ./hack/cloned.flows.netobserv.io_flowcollectors.yaml

.PHONY: clean-generated-conversions
clean-generated-conversions: ## Remove files generated by conversion-gen from the mentioned dirs
@@ -382,7 +400,6 @@ bundle: bundle-prepare ## Generate final bundle files.
update-bundle: VERSION=$(BUNDLE_VERSION)
update-bundle: IMAGE_ORG=netobserv
update-bundle: bundle ## Prepare a clean bundle to be commited
cat ./config/crd/bases/flows.netobserv.io_flowcollectors.yaml | yq eval-all '(.spec.versions.[]|select(.name != "v1beta2").storage) = false,(.spec.versions.[]|select(.name == "v1beta2").storage) = true' > ./hack/cloned.flows.netobserv.io_flowcollectors.yaml

.PHONY: bundle-build
bundle-build: ## Build the bundle image.