Skip to content

Commit

Permalink
fix: make use of sed portable for BSD and GNU (kubernetes#8859)
Browse files Browse the repository at this point in the history
Signed-off-by: Ismayil Mirzali <[email protected]>
  • Loading branch information
Volatus authored and rchshld committed May 17, 2023
1 parent ba489a8 commit c8ec92c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hack/generate-deploy-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ do
--namespace ingress-nginx \
--kube-version ${K8S_VERSION} \
> $MANIFEST
sed -i '' '/app.kubernetes.io\/managed-by: Helm/d' $MANIFEST
sed -i '' '/helm.sh/d' $MANIFEST
sed -i.bak '/app.kubernetes.io\/managed-by: Helm/d' $MANIFEST
sed -i.bak '/helm.sh/d' $MANIFEST

kustomize --load-restrictor=LoadRestrictionsNone build . > ${OUTPUT_DIR}/deploy.yaml
rm $MANIFEST
rm $MANIFEST $MANIFEST.bak
cd ~-
# automatically generate the (unsupported) kustomization.yaml for each target
sed "s_{TARGET}_${TARGET}_" $TEMPLATE_DIR/static-kustomization-template.yaml > ${OUTPUT_DIR}/kustomization.yaml
Expand All @@ -68,7 +68,7 @@ do
if [[ ${K8S_VERSION} = ${K8S_DEFAULT_VERSION} ]]
then
cp ${OUTPUT_DIR}/*.yaml ${OUTPUT_DIR}/../
sed -i "s/^/#GENERATED FOR K8S ${K8S_VERSION}\n/" ${OUTPUT_DIR}/../deploy.yaml
sed -i.bak "s/^/#GENERATED FOR K8S ${K8S_VERSION}\n/" ${OUTPUT_DIR}/../deploy.yaml && rm ${OUTPUT_DIR}/../deploy.yaml.bak
fi
done
done

0 comments on commit c8ec92c

Please sign in to comment.