-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into psqluser-crd-fix
- Loading branch information
Showing
4 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
invalid_files=$(grep -L "cert-manager.io" ./config/crd/patches/cainjection*.yaml) | ||
|
||
# using a subshell to not modify the IFS variable that determines how the expression "${arr[*]}" is output | ||
# this workaround allows us to reject an array containing empty elements | ||
(IFS='' ; [[ -n "${invalid_files[*]}" ]] ); is_empty=$? | ||
|
||
# fail validation if the array is not empty | ||
if [[ $is_empty -eq 0 ]]; then | ||
echo "Validation check failed for the following files:" | ||
for file in $invalid_files; do | ||
echo " $file" | ||
done | ||
echo "Run the following command to fix the files:" | ||
echo " sed -i '' 's/certmanager.k8s.io/cert-manager.io/' ./config/crd/patches/cainjection*.yaml" | ||
exit 1 | ||
fi |