diff --git a/Makefile b/Makefile index 427f4845..691e214f 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ XPKG_REG_ORGS ?= xpkg.upbound.io/crossplane-contrib XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/crossplane-contrib XPKGS = provider-sql -include build/makelib/xpkg.mk +-include build/makelib/local.xpkg.mk # NOTE(hasheddan): we force image building to happen prior to xpkg build so that # we ensure image is present in daemon. @@ -83,10 +84,16 @@ generate: crds.clean # integration tests e2e.run: test-integration +CROSSPLANE_HELM_CHANNEL ?= stable +CROSSPLANE_HELM_CHART_VERSION ?= + # Run integration tests. test-integration: $(KIND) $(KUBECTL) $(CROSSPLANE_CLI) $(HELM) @$(INFO) running integration tests using kind $(KIND_VERSION) - @KIND_NODE_IMAGE_TAG=${KIND_NODE_IMAGE_TAG} $(ROOT_DIR)/cluster/local/integration_tests.sh || $(FAIL) + @KIND_NODE_IMAGE_TAG=${KIND_NODE_IMAGE_TAG} \ + CROSSPLANE_HELM_CHANNEL=${CROSSPLANE_HELM_CHANNEL} \ + CROSSPLANE_HELM_CHART_VERSION=${CROSSPLANE_HELM_CHART_VERSION} \ + $(ROOT_DIR)/cluster/local/integration_tests.sh || $(FAIL) @$(OK) integration tests passed # Update the submodules, such as the common build scripts. diff --git a/apis/cluster/mysql/v1alpha1/grant_types.go b/apis/cluster/mysql/v1alpha1/grant_types.go index 01f02691..1ba40436 100644 --- a/apis/cluster/mysql/v1alpha1/grant_types.go +++ b/apis/cluster/mysql/v1alpha1/grant_types.go @@ -29,7 +29,7 @@ type GrantSpec struct { } // GrantPrivilege represents a privilege to be granted -// +kubebuilder:validation:Pattern:=^[A-Z_ ]+$ +// +kubebuilder:validation:Pattern:="^[A-Za-z0-9_,() ]+$" type GrantPrivilege string // If Privileges are specified, we should have at least one diff --git a/apis/namespaced/mysql/v1alpha1/grant_types.go b/apis/namespaced/mysql/v1alpha1/grant_types.go index 2e0f88a6..7ae2279b 100644 --- a/apis/namespaced/mysql/v1alpha1/grant_types.go +++ b/apis/namespaced/mysql/v1alpha1/grant_types.go @@ -31,7 +31,7 @@ type GrantSpec struct { } // GrantPrivilege represents a privilege to be granted -// +kubebuilder:validation:Pattern:=^[A-Z_ ]+$ +// +kubebuilder:validation:Pattern:="^[A-Za-z0-9_,() ]+$" type GrantPrivilege string // If Privileges are specified, we should have at least one diff --git a/build b/build index 99c79f0c..907604dd 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 99c79f0c310d02157495f457f99b95370200c389 +Subproject commit 907604dd4d57eba8bcf94699d7834f68389b4f96 diff --git a/cluster/local/integration_tests.sh b/cluster/local/integration_tests.sh index 38365ccb..5a2cce29 100755 --- a/cluster/local/integration_tests.sh +++ b/cluster/local/integration_tests.sh @@ -44,8 +44,6 @@ eval $(make --no-print-directory -C ${projectdir} build.vars) SAFEHOSTARCH="${SAFEHOSTARCH:-amd64}" CONTROLLER_IMAGE="${BUILD_REGISTRY}/${PROJECT_NAME}-${SAFEHOSTARCH}" -version_tag="$(cat ${projectdir}/_output/version)" -# tag as latest version to load into kind cluster K8S_CLUSTER="${K8S_CLUSTER:-${BUILD_REGISTRY}-inttests}" PACKAGE_NAME="provider-sql" @@ -89,80 +87,10 @@ integration_tests_end() { } setup_cluster() { - echo_step "setting up local package cache" - - local cache_path="${projectdir}/.work/inttest-package-cache" - mkdir -p "${cache_path}/xpkg.crossplane.io" - echo "created cache dir at ${cache_path}" - "${CROSSPLANE_CLI}" xpkg extract --from-xpkg "${OUTPUT_DIR}"/xpkg/linux_"${SAFEHOSTARCH}"/"${PACKAGE_NAME}"-"${VERSION}".xpkg -o "${cache_path}/xpkg.crossplane.io/${PACKAGE_NAME}:latest.gz" - chmod 644 "${cache_path}/xpkg.crossplane.io/${PACKAGE_NAME}:latest.gz" - local node_image="kindest/node:${KIND_NODE_IMAGE_TAG}" echo_step "creating k8s cluster using kind ${KIND_VERSION} and node image ${node_image}" - local config="$( cat <