Skip to content

Commit

Permalink
Fix import-scrds script
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 30, 2023
1 parent 10a9610 commit 9e43854
Showing 1 changed file with 63 additions and 47 deletions.
110 changes: 63 additions & 47 deletions hack/scripts/import-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
set -eou pipefail

crd_dir=${1:-}/apimachinery/crds
update_kubedb_crds=true

api_repo_url=https://github.com/kubedb/apimachinery.git
api_repo_tag=${KUBEDB_APIMACHINERY_TAG:-master}
Expand All @@ -25,6 +26,7 @@ if [ "$#" -ne 1 ]; then
if [ "${api_repo_tag}" == "master" ]; then
echo "Skipping updating kubedb/apimachinery crds"
echo "To update use: import-crds.sh <path_to_input_crds_directory>"
update_kubedb_crds=false
else
tmp_dir=$(mktemp -d -t api-XXXXXXXXXX)
# always cleanup temp dir
Expand All @@ -44,56 +46,58 @@ if [ "$#" -ne 1 ]; then
fi
fi

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-crds/crds \
--group=kubedb.com \
--group=catalog.kubedb.com \
--group=config.kubedb.com \
--group=ops.kubedb.com \
--group=autoscaling.kubedb.com \
--group=dashboard.kubedb.com \
--group=postgres.kubedb.com \
--group=archiver.kubedb.com \
--group=schema.kubedb.com
if [ "$update_kubedb_crds" = true ]; then
crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-crds/crds \
--group=kubedb.com \
--group=catalog.kubedb.com \
--group=config.kubedb.com \
--group=ops.kubedb.com \
--group=autoscaling.kubedb.com \
--group=dashboard.kubedb.com \
--group=postgres.kubedb.com \
--group=archiver.kubedb.com \
--group=schema.kubedb.com

crd-importer \
--input=${crd_dir} \
--out=. --output-yaml=crds/kubedb-crds.yaml \
--group=kubedb.com \
--group=catalog.kubedb.com \
--group=config.kubedb.com \
--group=ops.kubedb.com \
--group=autoscaling.kubedb.com \
--group=dashboard.kubedb.com \
--group=postgres.kubedb.com \
--group=archiver.kubedb.com \
--group=schema.kubedb.com
crd-importer \
--input=${crd_dir} \
--out=. --output-yaml=crds/kubedb-crds.yaml \
--group=kubedb.com \
--group=catalog.kubedb.com \
--group=config.kubedb.com \
--group=ops.kubedb.com \
--group=autoscaling.kubedb.com \
--group=dashboard.kubedb.com \
--group=postgres.kubedb.com \
--group=archiver.kubedb.com \
--group=schema.kubedb.com

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-catalog/crds \
--group=catalog.kubedb.com
crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-catalog/crds \
--group=catalog.kubedb.com

crd-importer \
--input=${crd_dir} \
--out=. --output-yaml=crds/kubedb-catalog-crds.yaml \
--group=catalog.kubedb.com

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-ui-server/crds \
--group=kubedb.com
fi

crd-importer \
--input=https://github.com/kubestash/apimachinery/raw/master/crds/addons.kubestash.com_addons.yaml \
--input=https://github.com/kubestash/apimachinery/raw/master/crds/addons.kubestash.com_functions.yaml \
--out=./charts/kubedb-kubestash-catalog/crds

crd-importer \
--input=${crd_dir} \
--out=. --output-yaml=crds/kubedb-catalog-crds.yaml \
--group=catalog.kubedb.com

crd-importer \
--input=https://github.com/kmodules/custom-resources/raw/v0.25.1/crds/metrics.appscode.com_metricsconfigurations.yaml \
--out=./charts/kubedb-metrics/crds

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-ui-server/crds \
--group=kubedb.com

crd-importer \
--input=https://github.com/open-viz/apimachinery/raw/v0.0.5/crds/openviz.dev_grafanadashboards.yaml \
--out=./charts/kubedb-grafana-dashboards/crds
Expand All @@ -104,6 +108,7 @@ crd-importer \

{
crd_dir=${1:-}/provider-aws/package/crds
update_aws_crds=true

repo_url=https://github.com/kubedb/provider-aws.git
repo_tag=${KUBEDB_PROVIDER_AWS_TAG:-main}
Expand All @@ -112,6 +117,7 @@ crd-importer \
if [ "${repo_tag}" == "main" ]; then
echo "Skipping updating kubedb/provider-aws crds"
echo "To update use: import-crds.sh <path_to_input_crds_directory>"
update_aws_crds=false
else
tmp_dir=$(mktemp -d -t api-XXXXXXXXXX)
# always cleanup temp dir
Expand All @@ -131,12 +137,15 @@ crd-importer \
fi
fi

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-aws/crds
if [ "$update_aws_crds" = true ]; then
crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-aws/crds
fi
}
{
crd_dir=${1:-}/provider-azure/package/crds
update_azure_crds=true

repo_url=https://github.com/kubedb/provider-azure.git
repo_tag=${KUBEDB_PROVIDER_AZURE_TAG:-main}
Expand All @@ -145,6 +154,7 @@ crd-importer \
if [ "${repo_tag}" == "main" ]; then
echo "Skipping updating kubedb/provider-azure crds"
echo "To update use: import-crds.sh <path_to_input_crds_directory>"
update_azure_crds=false
else
tmp_dir=$(mktemp -d -t api-XXXXXXXXXX)
# always cleanup temp dir
Expand All @@ -164,12 +174,15 @@ crd-importer \
fi
fi

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-azure/crds
if [ "$update_azure_crds" = true ]; then
crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-azure/crds
fi
}
{
crd_dir=${1:-}/provider-gcp/package/crds
update_gcp_crds=true

repo_url=https://github.com/kubedb/provider-gcp.git
repo_tag=${KUBEDB_PROVIDER_GCP_TAG:-main}
Expand All @@ -178,6 +191,7 @@ crd-importer \
if [ "${repo_tag}" == "main" ]; then
echo "Skipping updating kubedb/provider-gcp crds"
echo "To update use: import-crds.sh <path_to_input_crds_directory>"
update_gcp_crds=false
else
tmp_dir=$(mktemp -d -t api-XXXXXXXXXX)
# always cleanup temp dir
Expand All @@ -197,7 +211,9 @@ crd-importer \
fi
fi

crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-gcp/crds
if [ "$update_gcp_crds" = true ]; then
crd-importer \
--input=${crd_dir} \
--out=./charts/kubedb-provider-gcp/crds
fi
}

0 comments on commit 9e43854

Please sign in to comment.