diff --git a/Makefile b/Makefile index 4ece242dc..1487ade6b 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Linux doesn't guarantee file ordering, so sort the files to make sure order is deterministic. +# And in order to handle file paths with spaces, it's easiest to read the file names into an array. +# Set locale `LC_ALL=C` because different OSes have different sort behavior; +# `C` sorting order is based on the byte values, +# Reference: https://blog.zhimingwang.org/macos-lc_collate-hunt +LC_ALL=C +export LC_ALL + include build/makelib/common.mk include build/makelib/helm.mk diff --git a/build/crds/build-crds.sh b/build/crds/build-crds.sh index 1f40effe2..06c652a8c 100755 --- a/build/crds/build-crds.sh +++ b/build/crds/build-crds.sh @@ -97,13 +97,6 @@ fi generating_main_crd -# Linux doesn't guarantee file ordering, so we must sort the output to make sure it's deterministic. -# In order to handle file paths with spaces in the yq command below, it's easiest to read the -# file names into an array. -# Set locale `LC_ALL=C` because different OSes have different sort behavior; -# `C` sorting order is based on the byte values, -# Reference: https://blog.zhimingwang.org/macos-lc_collate-hunt -LC_ALL=C CRD_FILES=() while read -r line; do CRD_FILES+=("$line") diff --git a/build/rbac/keep-rbac-yaml.sh b/build/rbac/keep-rbac-yaml.sh index b235846c3..098df8364 100755 --- a/build/rbac/keep-rbac-yaml.sh +++ b/build/rbac/keep-rbac-yaml.sh @@ -35,12 +35,6 @@ sed '/^# Source: /d' | # helm adds '# Source: ' comments atop of each yaml $YQ eval --split-exp '.kind + " " + .metadata.name + " "' - # split into files by .yaml # outputting the filenames with spaces after kind and name keeps the same sorting from before -# Linux doesn't guarantee file ordering, so sort the files to make sure order is deterministic. -# And in order to handle file paths with spaces, it's easiest to read the file names into an array. -# Set locale `LC_ALL=C` because different OSes have different sort behavior; -# `C` sorting order is based on the byte values, -# Reference: https://blog.zhimingwang.org/macos-lc_collate-hunt -LC_ALL=C RBAC_FILES=() while read -r line; do RBAC_FILES+=("$line")