File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
apis/apiextensions/v1alpha1 Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import (
2626// +kubebuilder:object:root=true
2727// +kubebuilder:storageversion
2828// +genclient
29- // +kubebuilder:storageversion
3029// +genclient:nonNamespaced
3130
3231// An EnvironmentConfig contains user-defined unstructured values for
Original file line number Diff line number Diff line change @@ -24,17 +24,16 @@ FROM_PACKAGE=$(basename ${FROM_DIR})
2424TO_PACKAGE=$( basename ${TO_DIR} )
2525TO_PATH=" ${TO_DIR} /zz_generated.${FROM_FILE} "
2626
27- if [ " ${STORAGE_VERSION} " = " true" ] && grep -q " +kubebuilder:storageversion" ${FROM_PATH} ; then
28- echo " Error: ${FROM_PATH} is a storage version and cannot be duplicated without dropping the storage version marker."
29- exit 1
30- fi
31-
3227sed " s#^package ${FROM_PACKAGE} \$ #${DO_NOT_EDIT} \n\npackage ${TO_PACKAGE} #" ${FROM_PATH} > ${TO_PATH}
3328
3429case $STORAGE_VERSION in
3530 true)
31+ if grep -q " +kubebuilder:storageversion" ${FROM_PATH} ; then
32+ echo " Error: ${FROM_PATH} is marked as storage version and cannot be duplicated without dropping the marker."
33+ exit 1
34+ fi
3635 # Add the storageVersion marker before // +genclient
37- sed -i ' \/\/ +genclient/i\/\/ +kubebuilder:storageversion' ${TO_PATH}
36+ sed -i ' \/\/ +genclient$ /i\/\/ +kubebuilder:storageversion' ${TO_PATH}
3837 echo " Duplicated ${FROM_PATH} (package ${FROM_PACKAGE} ) to ${TO_PATH} (package ${TO_PACKAGE} )."
3938 ;;
4039 false)
You can’t perform that action at this time.
0 commit comments