mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
move patch routine to copy crd (#261)
This can avoid redudant file generated in _output Signed-off-by: Jian Qiu <jqiu@redhat.com>
This commit is contained in:
9
Makefile
9
Makefile
@@ -49,12 +49,9 @@ $(call build-image,registration-operator,$(OPERATOR_IMAGE_NAME),./build/Dockerfi
|
||||
$(call build-image,addon-manager,$(ADDON_MANAGER_IMAGE),./build/Dockerfile.addon,.)
|
||||
|
||||
copy-crd:
|
||||
bash -x hack/copy-crds.sh
|
||||
bash -x hack/copy-crds.sh $(YAML_PATCH)
|
||||
|
||||
patch-crd: ensure-yaml-patch
|
||||
bash hack/patch/patch-crd.sh $(YAML_PATCH)
|
||||
|
||||
update: patch-crd copy-crd update-csv
|
||||
update: copy-crd update-csv
|
||||
|
||||
update-csv: ensure-operator-sdk
|
||||
cd deploy/cluster-manager && ../../$(OPERATOR_SDK) generate bundle --version $(CSV_VERSION) --package cluster-manager --input-dir config --output-dir olm-catalog/cluster-manager
|
||||
@@ -64,7 +61,7 @@ update-csv: ensure-operator-sdk
|
||||
rm ./deploy/cluster-manager/bundle.Dockerfile
|
||||
rm ./deploy/klusterlet/bundle.Dockerfile
|
||||
|
||||
verify-crds: patch-crd
|
||||
verify-crds:
|
||||
bash -x hack/verify-crds.sh
|
||||
|
||||
verify-gocilint:
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/init.sh"
|
||||
|
||||
BASE_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
for f in $HUB_CRD_FILES
|
||||
do
|
||||
if [ -f "$PATCHED_DIR/$(basename $f)" ]
|
||||
if [ -f "$BASE_DIR/$(basename $f).yaml-patch" ];
|
||||
then
|
||||
cp $PATCHED_DIR/$(basename $f) ./manifests/cluster-manager/hub/
|
||||
$1 -o $BASE_DIR/$(basename $f).yaml-patch < $f > ./manifests/cluster-manager/hub/$(basename $f)
|
||||
else
|
||||
cp $f ./manifests/cluster-manager/hub/
|
||||
fi
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Example patch file 0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml.yaml-patch
|
||||
# - op: add
|
||||
# path: /spec/conversion
|
||||
# value:
|
||||
# strategy: Webhook
|
||||
# webhook:
|
||||
# clientConfig:
|
||||
# service:
|
||||
# namespace: {{ .ClusterManagerNamespace }}
|
||||
# name: cluster-manager-registration-webhook
|
||||
# path: /convert
|
||||
# port: {{.RegistrationWebhook.Port}}
|
||||
# caBundle: {{ .RegistrationAPIServiceCABundle }}
|
||||
# conversionReviewVersions:
|
||||
# - v1beta1
|
||||
# - v1beta2
|
||||
|
||||
BASE_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
source "$BASE_DIR/../init.sh"
|
||||
|
||||
for f in $HUB_CRD_FILES
|
||||
do
|
||||
if [ -f "$BASE_DIR/$(basename $f).yaml-patch" ]; then
|
||||
$1 -o $BASE_DIR/$(basename $f).yaml-patch < $f > $PATCHED_DIR/$(basename $f)
|
||||
fi
|
||||
done
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/init.sh"
|
||||
|
||||
BASE_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
for f in $HUB_CRD_FILES
|
||||
do
|
||||
if [ -f "$PATCHED_DIR/$(basename $f)" ]
|
||||
if [ -f "$BASE_DIR/$(basename $f).yaml-patch" ];
|
||||
then
|
||||
diff -N $PATCHED_DIR/$(basename $f) ./manifests/cluster-manager/hub/$(basename $f) || ( echo 'crd content is incorrect' && false )
|
||||
$1 -o $BASE_DIR/$(basename $f).yaml-patch < $f > ./manifests/cluster-manager/hub/$(basename $f).tmp
|
||||
diff -N ./manifests/cluster-manager/hub/$(basename $f).tmp ./manifests/cluster-manager/hub/$(basename $f) || ( echo 'crd content is incorrect' && false )
|
||||
rm ./manifests/cluster-manager/hub/$(basename $f).tmp
|
||||
else
|
||||
diff -N $f ./manifests/cluster-manager/hub/$(basename $f) || ( echo 'crd content is incorrect' && false )
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user