diff --git a/hack/generate-manifests.sh b/hack/generate-manifests.sh index 8d5f02886..f978f8a30 100755 --- a/hack/generate-manifests.sh +++ b/hack/generate-manifests.sh @@ -2,18 +2,25 @@ drivers=( aws-ebs azure-disk azure-file ) -for driver in "${drivers[@]}" -do - oc kustomize \ - assets/csidriveroperators/${driver}/hypershift/guest \ - -o assets/csidriveroperators/${driver}/hypershift/guest/generated +for driver in "${drivers[@]}"; do + # Ignore drivers that don't (yet) support HyperShift + if [ -d "assets/csidriveroperators/${driver}/hypershift" ]; then + rm -rf "assets/csidriveroperators/${driver}/hypershift/guest/generated" + mkdir -p "assets/csidriveroperators/${driver}/hypershift/guest/generated" + oc kustomize \ + "assets/csidriveroperators/${driver}/hypershift/guest" \ + -o "assets/csidriveroperators/${driver}/hypershift/guest/generated" - oc kustomize \ - assets/csidriveroperators/${driver}/hypershift/mgmt \ - -o assets/csidriveroperators/${driver}/hypershift/mgmt/generated + rm -rf "assets/csidriveroperators/${driver}/hypershift/mgmt/generated" + mkdir -p "assets/csidriveroperators/${driver}/hypershift/mgmt/generated" + oc kustomize \ + "assets/csidriveroperators/${driver}/hypershift/mgmt" \ + -o "assets/csidriveroperators/${driver}/hypershift/mgmt/generated" + fi + rm -rf "assets/csidriveroperators/${driver}/standalone/generated" + mkdir -p "assets/csidriveroperators/${driver}/standalone/generated" oc kustomize \ - assets/csidriveroperators/${driver}/standalone \ - -o assets/csidriveroperators/${driver}/standalone/generated + "assets/csidriveroperators/${driver}/standalone" \ + -o "assets/csidriveroperators/${driver}/standalone/generated" done -