Skip to content

Commit

Permalink
Update upjet to 1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: SK Ali Arman <[email protected]>
  • Loading branch information
sheikh-arman committed Nov 20, 2023
1 parent 2017aed commit da33622
Show file tree
Hide file tree
Showing 320 changed files with 24,337 additions and 8,323 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ linters-settings:
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/upbound/upjet-provider-template
local-prefixes: github.com/crossplane/upjet-provider-template

gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
Expand Down
56 changes: 48 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PROJECT_NAME ?= provider-aws
PROJECT_REPO ?= kubedb.dev/$(PROJECT_NAME)

export TERRAFORM_VERSION ?= 1.3.3
export TERRAFORM_VERSION ?= 1.5.5

export TERRAFORM_PROVIDER_SOURCE ?= hashicorp/aws
export TERRAFORM_PROVIDER_REPO ?= https://github.com/hashicorp/terraform-provider-aws
Expand Down Expand Up @@ -40,7 +40,7 @@ NPROCS ?= 1
# to half the number of CPU cores.
GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))

GO_REQUIRED_VERSION ?= 1.20
GO_REQUIRED_VERSION ?= 1.19
GOLANGCILINT_VERSION ?= 1.50.0
GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider $(GO_PROJECT)/cmd/generator
GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION)
Expand All @@ -51,18 +51,17 @@ GO_SUBDIRS += cmd internal apis
# Setup Kubernetes tools

KIND_VERSION = v0.15.0
UP_VERSION = v0.14.0
UP_VERSION = v0.18.0
UP_CHANNEL = stable
UPTEST_VERSION = v0.2.1
UPTEST_VERSION = v0.5.0
-include build/makelib/k8s_tools.mk

# ====================================================================================
# Setup Images

REGISTRY_ORGS ?= xpkg.upbound.io/upbound
IMAGES = $(PROJECT_NAME)
DOCKER_REGISTRY=ghcr.io/kubedb
-include build/makelib/image.mk
-include build/makelib/imagelight.mk

# ====================================================================================
# Setup XPKG
Expand All @@ -72,7 +71,7 @@ XPKG_REG_ORGS ?= xpkg.upbound.io/upbound
# inferred.
XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/upbound
XPKGS = $(PROJECT_NAME)
# -include build/makelib/xpkg.mk
-include build/makelib/xpkg.mk

# ====================================================================================
# Fallthrough
Expand Down Expand Up @@ -167,9 +166,23 @@ CROSSPLANE_NAMESPACE = upbound-system
-include build/makelib/local.xpkg.mk
-include build/makelib/controlplane.mk

# This target requires the following environment variables to be set:
# - UPTEST_EXAMPLE_LIST, a comma-separated list of examples to test
# To ensure the proper functioning of the end-to-end test resource pre-deletion hook, it is crucial to arrange your resources appropriately.
# You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/awss/01-delete.yaml.tmpl.
# - UPTEST_CLOUD_CREDENTIALS (optional), multiple sets of AWS IAM User credentials specified as key=value pairs.
# The support keys are currently `DEFAULT` and `PEER`. So, an example for the value of this env. variable is:
# DEFAULT='[default]
# aws_access_key_id = REDACTED
# aws_secret_access_key = REDACTED'
# PEER='[default]
# aws_access_key_id = REDACTED
# aws_secret_access_key = REDACTED'
# The associated `ProviderConfig`s will be named as `default` and `peer`.
# - UPTEST_DATASOURCE_PATH (optional), see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource
uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
@$(INFO) running automated tests
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --setup-script=cluster/test/setup.sh || $(FAIL)
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --data-source="${UPTEST_DATASOURCE_PATH}" --setup-script=cluster/test/setup.sh --default-conditions="Test" || $(FAIL)
@$(OK) running automated tests

local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME)
Expand All @@ -180,6 +193,33 @@ local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME)

e2e: local-deploy uptest

crddiff: $(UPTEST)
@$(INFO) Checking breaking CRD schema changes
@for crd in $${MODIFIED_CRD_LIST}; do \
if ! git cat-file -e "$${GITHUB_BASE_REF}:$${crd}" 2>/dev/null; then \
echo "CRD $${crd} does not exist in the $${GITHUB_BASE_REF} branch. Skipping..." ; \
continue ; \
fi ; \
echo "Checking $${crd} for breaking API changes..." ; \
changes_detected=$$($(UPTEST) crddiff revision <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
if [[ $$? != 0 ]] ; then \
printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \
echo "$${changes_detected}" ; \
echo ; \
fi ; \
done
@$(OK) Checking breaking CRD schema changes

schema-version-diff:
@$(INFO) Checking for native state schema version changes
@export PREV_PROVIDER_VERSION=$$(git cat-file -p "${GITHUB_BASE_REF}:Makefile" | sed -nr 's/^export[[:space:]]*TERRAFORM_PROVIDER_VERSION[[:space:]]*:=[[:space:]]*(.+)/\1/p'); \
echo Detected previous Terraform provider version: $${PREV_PROVIDER_VERSION}; \
echo Current Terraform provider version: $${TERRAFORM_PROVIDER_VERSION}; \
mkdir -p $(WORK_DIR); \
git cat-file -p "$${GITHUB_BASE_REF}:config/schema.json" > "$(WORK_DIR)/schema.json.$${PREV_PROVIDER_VERSION}"; \
./scripts/version_diff.py config/generated.lst "$(WORK_DIR)/schema.json.$${PREV_PROVIDER_VERSION}" config/schema.json
@$(OK) Checking for native state schema version changes

.PHONY: cobertura submodules fallthrough run crds.clean

# ====================================================================================
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Provider AWS

`provider-aws` is a [Crossplane](https://crossplane.io/) provider that
is built using [Upjet](https://github.com/upbound/upjet) code
is built using [Upjet](https://github.com/crossplane/upjet) code
generation tools and exposes XRM-conformant managed resources for the
AWS API.

Expand Down
87 changes: 86 additions & 1 deletion apis/docdb/v1alpha1/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 60 additions & 2 deletions apis/docdb/v1alpha1/zz_clusterinstance_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da33622

Please sign in to comment.