So I have multiple sed commands I will like to put together as one. Any pointer will be appreciated, I believe this is a sort of advanced SED and I have tried to no success:
sed -E '/limits:/!b;n;s/^([[:blank:]]*cpu: ).*/\\1900m/' mychart.yaml
sed -E '/limits:/!b;n;n;s/^([[:blank:]]*memory: ).*/\\1900Mi/' mychart.yaml
sed -E '/requests:/!b;n;s/^([[:blank:]]*cpu: ).*/\\1700m/' mychart.yaml
sed -E '/requests:/!b;n;n;s/^([[:blank:]]*memory: ).*/\\1500Mi/' mychart.yaml
Below is the mychart.yaml context I am using the above commands to replace the values:
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 250m
memory: 256Mi
Thank you all!