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

Switch to new crossplane build module, consume KCL #69

Merged
merged 1 commit into from
Aug 2, 2024
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
11 changes: 11 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "upbound/uptest",
}, {
"customType": "regex",
"description": "Bump Crossplane(UXP) version in the Makefile",
"fileMatch": ["^Makefile$"],
"matchStrings": [
"CROSSPLANE_VERSION = (?<currentValue>.*?)\\n"
],
"datasourceTemplate": "github-releases",
"versioningTemplate": "regex:^v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-up.1$",
"extractVersionTemplate": "^v(?<version>.*)$",
"depNameTemplate": "upbound/universal-crossplane",
}, {
"customType": "regex",
"description": "Bump providers/functions/configurations in crossplane.yaml",
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "build"]
path = build
url = https://github.com/upbound/build
url = https://github.com/crossplane/build
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ PLATFORMS ?= linux_amd64
UP_VERSION = v0.27.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.11.1
CROSSPLANE_CLI_VERSION=v1.16.0

-include build/makelib/k8s_tools.mk
# ====================================================================================
Expand All @@ -27,8 +28,12 @@ XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/upbound
XPKGS = $(PROJECT_NAME)
-include build/makelib/xpkg.mk

CROSSPLANE_VERSION = 1.16.0-up.1
CROSSPLANE_CHART_REPO = https://charts.upbound.io/stable
CROSSPLANE_CHART_NAME = universal-crossplane
CROSSPLANE_NAMESPACE = upbound-system
CROSSPLANE_ARGS = "--enable-usages"
KIND_CLUSTER_NAME = uptest-$(PROJECT_NAME)
-include build/makelib/local.xpkg.mk
-include build/makelib/controlplane.mk

Expand All @@ -46,8 +51,7 @@ fallthrough: submodules
@echo Initial setup complete. Running make again . . .
@make

# Update the submodules, such as the common build scripts.
submodules:
submodules: ## Update the submodules, such as the common build scripts.
@git submodule sync
@git submodule update --init --recursive

Expand All @@ -72,21 +76,23 @@ uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
# This target requires the following environment variables to be set:
# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials)
# Use `make e2e SKIP_DELETE=--skip-delete` to skip deletion of resources created during the test.
e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest
e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest ## Run uptest together with all dependencies. Use `make e2e SKIP_DELETE=--skip-delete` to skip deletion of resources.

render:
crossplane beta render examples/eks-xr.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/eks-xr.yaml apis/composition-kcl.yaml examples/functions.yaml -r
kcl-generate: $(KCL) ## Generate KCL-based Composition
$(KCL) generate-composition.k

kcl-generate:
kcl generate-composition.k
render-kcl: kcl-generate $(CROSSPLANE_CLI) ## Crossplane render kcl generated composition
$(CROSSPLANE_CLI) beta render examples/eks-xr.yaml apis/composition-kcl-generated.yaml examples/functions.yaml -r

render-kcl: kcl-generate
crossplane beta render examples/eks-xr.yaml apis/composition-kcl-generated.yaml examples/functions.yaml -r
render: $(CROSSPLANE_CLI) ## Crossplane render
$(CROSSPLANE_CLI) beta render examples/eks-xr.yaml apis/composition.yaml examples/functions.yaml -r

yamllint:
yamllint: ## Static yamllint check
@$(INFO) running yamllint
@yamllint ./apis || $(FAIL)
@$(OK) running yamllint

.PHONY: uptest e2e render yamllint
help.local:
@grep -E '^[a-zA-Z_-]+.*:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: uptest e2e render yamllint help.local